pip command not found after installed it

Andrew picture Andrew · Apr 3, 2018 · Viewed 33.8k times · Source

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.

To run the script I should have both Python and Moviepy installed.

To install Moviepy I used this command:

sudo pip install moviepy

The response was:

sudo: pip: command not found

So I tried to install pip, with the command:

sudo easy_install pip

And got this answer:

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

I tried to run again the

sudo pip install moviepy

but I still got that issue. What I should do?

UPDATE:

not sure on OSX, but can u try pip3 – Rehan Azher 23 mins ago

sudo pip3 install moviepy
Password:
sudo: pip3: command not found

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

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)

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

Tried to install homebrew but it cannot find the package moviepy that I am looking for.

Answer

guillerey picture guillerey · Jul 25, 2020

Try with this:

pip3 install package-name

This works for me!