You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OSX系统安装pip后仍提示‘pip: command not found’问题求助

解决OSX上pip命令找不到的问题

Hey Andrew, let's work through why your pip command isn't being recognized even though easy_install says it's already installed. Here are some straightforward fixes to get you up and running with MoviePy:

方法1:用Python模块方式调用pip(最稳妥)

Instead of typing just pip, use Python's built-in module system to invoke it—this avoids any PATH-related confusion and ensures you're using the pip tied to your active Python version:

sudo python -m pip install moviepy

This should directly trigger the pip installation for MoviePy without needing to hunt for the pip executable.

方法2:手动定位pip的路径

If the above doesn't work, let's find where pip is actually installed:

  • First, run this command to check if your system can locate pip:

    which pip
    

    Or since your pip is for Python 2.7, try:

    which pip2
    

    If this returns nothing, pip's directory isn't in your system's PATH.

  • Next, search for pip's exact location:

    find /usr/local/bin -name pip
    

    You'll likely see something like /usr/local/bin/pip as the result. Use this full path to run the installation:

    sudo /usr/local/bin/pip install moviepy
    

方法3:将pip目录添加到系统PATH(永久生效)

To make the pip command work directly in future terminal sessions, add its directory to your PATH:

  • Temporary fix (only for current terminal window):

    export PATH=/usr/local/bin:$PATH
    

    Now test with pip --version—it should show up! Then you can run sudo pip install moviepy as intended.

  • Permanent fix:
    Edit your shell configuration file (either ~/.bash_profile for Bash or ~/.zshrc for Zsh) and add this line at the bottom:

    export PATH=/usr/local/bin:$PATH
    

    Save the file, then restart your terminal or run source ~/.bash_profile (or source ~/.zshrc) to apply the changes. From now on, pip will be recognized whenever you open a terminal.

额外建议

OSX's built-in Python can sometimes have permission quirks. For long-term projects, consider using a virtual environment (like virtualenv or venv) to manage dependencies without needing sudo—but for getting MoviePy installed quickly, the above steps should do the trick.

内容的提问来源于stack exchange,提问作者Andrew

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:12:15