Python path in .bash_profile not respected

送分小仙女□ 提交于 2019-12-12 03:08:20

问题


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.


回答1:


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/



来源:https://stackoverflow.com/questions/32834016/python-path-in-bash-profile-not-respected

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!