zsh command cannot found pip

Maybe you have installed both python2 and python3. python3 may have been installed later.

You may try to use pip3 instead of pip.

First, input the command:

pip3 -V

If you see the version, the pip3 can be used.

Then you can input command line to install nltk:

pip3 install nltk

I got a way to help you use pip in zsh. We can use nano to edit files. In nano, ctrl+X to save and exit

In the ~ directory, input the command:

nano .bash_profile

You may see some codes like:

# Setting PATH for Python 3.5
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH

Copy them and paste them to the end of .zshrc file by using command:

nano .zshrc

Then input the command:

pip -V

If you see the version, pip can be used.


In case you do

which pip

and it doesn't show the path, just do

which pip3

This will print the path which is /usr/local/bin/pip3 Then do open ~/.zshrc or nano ~/.bash_profile.

Make alias for pip like:

alias pip=/usr/local/bin/pip3

N.B: You copy that line above and paste in your .zshrc file.

After do source ~/.zshrc and close .zshrc

Tags:

Pip

Oh My Zsh