Mac python command is not found

command is not found可能是因为路径没有写进.bash_profile文件。

.bash_profile打开方法:

若没有该文件则先创建再打开:

创建:touch.bash_profile

打开:open.bash_profile

 

注意:不能乱创建,因为会把系统自带的环境变量弄没,导致什么操作都不行。如果这样,那就先在终端打入临时使用路径export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin,暂时恢复基本功能。然后再去拯救.bash_profile, 并记得在里面加入export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

 

修改保存.bash_profile之后需要在终端resource .bash_profile

你可能感兴趣的:(Mac python command is not found)