% 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.
Facing issues? Have Questions? Post them here! I am happy to answer!
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
- Resolve - zsh: command not found: code
- zsh: command not found [fix] macOS
- How to fix: zsh: command not found: jupyter
- How to make ZSH as the default shell on Ubuntu
- How to Add New Entry to ZSH PATH
- Add Syntax Highlighting in Zsh Shell
- Fix: zsh: command not found: npm after installation (Node.js)
- Fix: zsh: command not found: mysql (Mac XAMPP)
- Ubuntu zsh: command not found: nano
- Fix: ZSH: cd: too many arguments (macOS)
- Fix - cd: no such file or directory: .zshrc
- How to reload zsh shell profile file?
- Fix zsh: permission denied: script.sh
- [fix] zsh: illegal hardware instruction python TensorFlow M1/M2 Mac
- macOS Ventura 13: The default interactive shell is now zsh
- How to Add Autocomplete in Mac Terminal
- Fix - zsh: command not found: pip
- ZSH: exec format error eclipse M1/M2 Mac
- Setting up Zsh Syntax Highlighting
- How to reload Zsh .zshrc Profile
- zsh: command not found: brew [fix]
- How to clear ZSH history of commands executed on Mac Terminal
- Fix - zsh: command not found: conda [macOS]
- Fix: cd: string not in pwd
- Program 4: Input Name and Age and Print - 1000+ Python Programs - Python-Programs
- Java SE JDBC: Insert with PreparedStatement Example - Java
- How to change the name of your Mac running on macOS Ventura 13 - MacOS
- Bash Hello World! Script Tutorial - Bash
- AppleScript Example with TextEdit - MacOS
- Notepad++ Keyboard Shortcuts Cheatsheet - Shortcuts
- How to Clear StringJoiner in Java 8 - Java
- Android Display Toast on Button Click - Android