简体   繁体   中英

Python path in .bash_profile not respected

Been Googling and searching here to no avail, so forgive me if this is a duplicate.

Basically, I installed Python 3.4 on my machine (Mac running Yosemite 10.10.2), but when I run python in Terminal, it starts up Python2.7.whatever, which I'm assuming is the version that is often mentioned as coming pre-installed on Macs. I've checked my ~/.bash_profile using vim, and here's what it currently contains:

# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH

# Virtualenv Wrapper stuff
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

Which, according to all the reading I've been doing, should work. But it isn't. Any and all thoughts as to why are appreciated.

Usually you would just type python3 or python3.4 to get a specific version. You should try that.

Most developers also use virtual environments which give you the ability to handle python versions and modules per application. There is an introduction at http://docs.python-guide.org/en/latest/dev/virtualenvs/

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