调整PATH优先级后pip无法找到的问题求助(Mac OS X High Sierra)
pip Command After Configuring Python 3 on Mac OS X High Sierra 10.13.3 Hey there, let's work through why your pip command isn't showing up even after fixing your Python version! Here are the most common fixes tailored to your setup:
1. First, Check if pip3 Works Instead
Since you've prioritized Python 3, the corresponding package manager is likely named pip3 (to distinguish it from the system's Python 2 pip). Try running this first:
pip3 --version
If this returns a valid version linked to Python 3, that's the root of the issue—your system just doesn't have a pip alias pointing to pip3.
2. Create a Symlink to Map pip to pip3
If pip3 works but pip doesn't, you can create a symbolic link in /usr/local/bin (which is high in your PATH) to make pip point to pip3:
sudo ln -s /usr/local/bin/pip3 /usr/local/bin/pip
Enter your admin password when prompted, then test pip --version again—it should now show the Python 3 pip version.
3. Verify pip Exists in /usr/local/bin
Let's confirm whether pip (or pip3) is actually present in the directory you prioritized:
ls /usr/local/bin | grep pip
If you don't see pip3 listed here, that means Python 3's pip wasn't installed properly. Reinstall Python 3 using the official installer for Mac, which automatically adds pip3 to /usr/local/bin.
4. Ensure Your PATH Changes Are Fully Applied
Sometimes modifying .profile doesn't take effect until you reload it or restart your terminal. Run this to reload your profile immediately:
source ~/.profile
Then check your PATH to confirm /usr/local/bin is still first:
echo $PATH
It should output your configured path (note you have /usr/local/bin listed twice—this is harmless, but you can simplify it to /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin if you want).
5. Double-Check Python 3 Installation
If none of the above works, verify that Python 3 is correctly installed in /usr/local/bin:
ls /usr/local/bin | grep python
You should see python3 listed here. If not, reinstall Python 3 to ensure the full package (including pip3) is set up correctly in your prioritized directory.
内容的提问来源于stack exchange,提问作者darkhelmet

