【发布时间】:2018-03-03 10:05:20
【问题描述】:
我曾经安装过python和python3。所以我可以决定使用哪个 python。我现在用自制软件更新了 python,并将 python3 迁移到了 python。我现在如何运行python2?
当我检查安装时,我得到:
$ python -V
Python 3.6.4
$ python2 -V
-bash: python2: command not found
$ python3 -V
Python 3.6.4
如果我尝试简单地重新安装 python2,我会得到:
$ brew install python2
Warning: python@2 2.7.14_1 is already installed
但是我不能使用 python2。
python2: command not found
【问题讨论】:
-
使用旧的、过时的、Apple 提供的
/usr/bin/python -
我没说要使用
python。我说用/usr/bin/python -V -
您可以将
pip作为您希望影响的Python模块执行.../usr/bin/python -m pip install --user somePackage -
@MarkSetchell 应用提供的 python 似乎没有 pip:
/usr/bin/python: No module named pip -
@MarkSetchell 有没有办法让'python' 指向
/usr/bin/pythonpython3 像以前一样指向 brew 的 python3?
标签: python python-2.7 homebrew