正如大多数在线解决方案所建议的,我做了以下事情:
open -e ~/.bash_profile
并添加了别名python ='python3'
这是我的.bash_profile的样子:
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
alias python='python3'
现在在终端上我得到了
Sakets-MacBook-Pro:~ theonlyroy$ python --version
Python 3.7.1
但是,我仍然无法安装pip软件包:
Sakets-MacBook-Pro:~ theonlyroy$ pip install praw
Collecting praw
Using cached https://files.pythonhosted.org/packages/f6/df/b42c0a3b86a43a62a46e5b2f07930230ac7719624800a2052218993fb767/praw-6.4.0-py2.py3-none-any.whl
praw requires Python '>=3.4' but the running Python is 2.7.10
我不明白为什么它说Python 2.7.x正在运行,或者我能做些什么来解决它。任何建议表示赞赏,谢谢!