安装后找不到pip命令 [英] pip command not found after installed it
问题描述
我遇到了一个问题.我有一个想在OSX上运行的Python脚本,但似乎在很多问题上都遇到了麻烦.
I'm stuck with an issue. I have a Python script that I would like to run on my OSX but seems that I crossed on many issues.
要运行脚本,我应该同时安装Python和Moviepy.
To run the script I should have both Python and Moviepy installed.
要安装Moviepy,我使用了以下命令:
To install Moviepy I used this command:
sudo pip install moviepy
答复为:
sudo: pip: command not found
因此,我尝试使用以下命令安装pip:
So I tried to install pip, with the command:
sudo easy_install pip
得到了这个答案:
Searching for pip
Best match: pip 9.0.1
Processing pip-9.0.1-py2.7.egg
pip 9.0.1 is already the active version in easy-install.pth
Using /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
我试图再次运行
sudo pip install moviepy
但是我仍然遇到那个问题.我该怎么办?
but I still got that issue. What I should do?
更新:
不确定是否在OSX上使用,但您可以在23分钟前尝试pip3 – Rehan Azher
not sure on OSX, but can u try pip3 – Rehan Azher 23 mins ago
sudo pip3 install moviepy
Password:
sudo: pip3: command not found
似乎pip不在您的路径中,但是只要Python可以找到它:sudo python -m pip install moviepy应该可以.检查您的$ PATH环境.可变– zwer 14分钟前
It seems that pip is not in your path, but as long as Python can find it: sudo python -m pip install moviepy should do it. Check your $PATH env. variable, tho. – zwer 14 mins ago
sudo python -m pip install moviepy
/usr/bin/python: No module named pip
UPDATE2
一个不错的选择是考虑使用OSX的其中一个安装pip来源,例如基于Debian的发行版中的apt程序,比easy_install.– 4小时前的湿婆(Shiva)
A good option for you is to consider installing pip using one of OSX's sources, like the apt program in Debian-based distributions, rather than easy_install. – Shiva 4 hours ago
sudo apt install moviepy
Password:
Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/apt" (-1)
不知道为什么每个人都会对此一无所知.你有一个使用Python时要做出的基本决定.您要么运行PythonApple发货的2.7,它很古老,没有pip,或者您使用自制软件安装了Python3和pip3,并将/usr/local/bin放在PATH的开始.但是不要尝试将两者混合使用.- 标记Setchell 3小时前
No idea why everyone keeps getting stuck on this. You have a fundamental decision to make when using Python. You either run Python 2.7 that Apple ships and which is ancient and doesn't have pip or you use homebrew and install Python3 and pip3 and put /usr/local/bin at the start of your PATH. But don't try a mixture of the two. – Mark Setchell 3 hours ago
试图安装自制软件,但找不到我要找的软件包moviepy.
Tried to install homebrew but it cannot find the package moviepy that I am looking for.
推荐答案
尝试以下方法:
pip3 install package-name
这对我有用!
这篇关于安装后找不到pip命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!