% pip install nltk
zsh: command not found pip
If you are using the zsh shell on your device (default shell for Mac) and you are trying to install a python module using the pip command and you get the error "zsh: command not found: pip", well there are few things you can try.
Try to make use of pip3 command instead of pip, as pip3 is the package manager for Python 3.x, while pip works with Python 2.x
% pip3 install nltk

Another reason for this error could be that you have not installed pip/pip3 on your device, you can do that by making use of the package manager for your device Operating system type.
Operating System | Package Manager | Command to Install pip3 |
---|---|---|
Ubuntu | apt-get | sudo apt-get install python3-pip |
Debian | apt-get | sudo apt-get install python3-pip |
CentOS | yum | sudo yum install python3-pip |
Fedora | dnf | sudo dnf install python3-pip |
macOS | Homebrew | brew install python3 (installs pip3 as well)
brew install pip3 |
Arch Linux | Pacman | sudo pacman -S python-pip |
Windows | - | pip is installed with Python setup. |
To know if you have pip
already installed on your device, you can check that using the command,
% which pip
/opt/homebrew/bin/pip
One reason if you still get the error "zsh: command not found pip" could be that you have not set pip
to the zsh profile file.
Open the .zshrc file and add the export "PATH=$PATH:/path/to/pip_or_pip3" and restart your terminal and check.
Have Questions? Post them here!
- How to make zsh as the default shell on Ubuntu
- Resolve - zsh: command not found: code
- Fix - zsh: command not found: conda [macOS]
- zsh: command not found [fix] macOS
- Setting up Zsh Syntax Highlighting
- Fix for zsh: command not found: brew
- Fix zsh: permission denied: script.sh
- [fix] zsh: illegal hardware instruction python TensorFlow M1/M2 Mac
- How to clear ZSH history of commands executed on Mac Terminal
- Ubuntu zsh: command not found: nano
- How to reload zsh shell profile file?
- macOS Ventura 13: The default interactive shell is now zsh
- zsh: exec format error eclipse M1 Mac
- Android Toolbar example with appcompat_v7 21 - Android
- Shortcut: Cut (or Delete) current line in Visual Studio Code (VSCode) - HowTos
- Python range() function examples - Python
- Fixed Length Android Edittext - Android
- SwissCovid App Launched in Switzerland - News
- How to Disable EditText Keyboard Android App - Android
- How to create an Autocomplete Android EditText Example - Android
- Convert JSON to Gson with type as ArrayList - Java