mac zsh: command not found: pip 解决方法

49 阅读1分钟

mac zsh: command not found: pip 解决方法

参考了这篇文章:www.cnblogs.com/luckyjcx/p/… 第一步先下载:

curl https://bootstrap.pypa.io/pip/get-pip.py -o get-pip.py

第二步安装:

sudo python3 get-pip.py

(注意,如果出现如下图黄字部分警告,如** WARNING: The script wheel is installed in '/Library/Frameworks/Python.framework/Versions/3.11/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.**)需要将其添加到path

image.png

将你的黄色警告的文件目录部分添加到环境变量文件中:

echo 'export PATH=/Library/Frameworks/Python.framework/Versions/3.11/bin:$PATH' >> ~/.bash_profile

使得变量生效:

source ~/.bash_profile

验证:

pip3

image.png