简体   繁体   中英

Using Homebrew python instead of system provided python

I used Homebrew to install python, the version is 2.7.10, and the system provided version is 2.7.6. My PATH environment variable is set to /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" , so my terminal DOES know to look at the Homebrew bin folder first!

However, when I run python, it still defaults to 2.7.6, the system provided version (the interpreter that shows up says 2.7.6 at the top). If I run /usr/local/bin/python , it runs 2.7.10, which is what I want.

If my PATH variable is properly set, then how is it possible that terminal still finds /usr/bin/python first?

This happened to me when I installed Python 2.7.10 using brew. My PATH was set to /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin and which python returned /usr/local/bin/python (which is symlinked to Python 2.7.10.)

Problem went away when I closed and restarted Terminal application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM