路径顺序正确:仍然指向Unbrewed Python

时间:2017-07-26 23:12:37

标签: python homebrew

我想使用我自己酿造的python版本,但是虽然许多论坛都说要调整路径顺序,以便不使用与路径/ usr / bin对应的OS X python。我发现虽然我的路径设置正确,但我仍然在调用旧的OS X python。

justins-mbp:~ justinthong$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

正如您在使用which python命令时所看到的那样,它仍然为我提供了原始路径。

justins-mbp:site-packages justinthong$ which python
/usr/bin/python

我正在努力不要强制使用符号链接。

1 个答案:

答案 0 :(得分:0)

运行:

brew info python

给出了你问题的答案:

  

此公式将python2可执行文件安装到/usr/local/bin。   如果您希望在PATH中使用此公式的python可执行文件,请添加   以下~/.bash_profile

     

export PATH="/usr/local/opt/python/libexec/bin:$PATH"