python - 当我在 mac 上安装了 python 3.5 时,终端运行 python 2.7。

标签 python macos python-2.7 python-3.5

我在我的 mac 上安装、卸载和重新安装 pythons, 我认为事情有点搞砸了。

起初默认情况下,终端在我输入时运行 Python 3.5

$python

,但在做了一些事情之后,它安装了 2.7,现在终端运行 python 2.7 而不是 3.5

我安装了 python 3.5 形式 http://python.org/ .

当我打开 bash_profile 时

$vim ~/.bash_profile

这是显示的内容

# virtualenv
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh


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

现在当我输入时:

$ python

这显示:

Python 2.7.11 (default, Jun 23 2016, 17:25:20) 
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

如何将所有 python 东西(删除旧版本等)重置为我第一次购买 Mac(python3.5) 时的出厂版本?

最佳答案

这对我有用:

Python 3.x

python3

Python 2.x

python

in terminal

关于python - 当我在 mac 上安装了 python 3.5 时,终端运行 python 2.7。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37986572/

相关文章:

python - cProfile 在运行多处理 Python 代码时导致 pickle 错误

python - 从 Django 1.3 移动到 Django 1.11 object_list

python - matplotlib 散点图颜色作为第三个和第四个变量的函数

objective-c - 在 Objective-C/Cocoa/SQL 中使用希腊字母

javascript - 使用ajax作为评论表单,它给了我500内部错误,但没有脚本它可以工作,这意味着我的脚本是错误的;对吗?

objective-c - 持久存储 Cocoa/MacOSX

javascript - 如何在 Mac OS X 上的新 Visual Studio Code 中编译 TypeScript 文件

python - 描述符 : Precendence of Attribute access through __getattribute()__

python - 压缩文件路径中的所有文件

python-2.7 - 根据类型或类别列出 Microsoft Azure 计算中的 VM 大小