【发布时间】:2017-06-06 02:23:57
【问题描述】:
我在 macOS 10.12 上运行,我正在尝试使用以下方式安装 Django:
pip install Django==1.10.5
我收到此错误:
Your PYTHONPATH points to a site-packages dir for Python 3.x but you are running Python 2.x!
PYTHONPATH is currently: "/usr/local/lib/python3.6/site-packages:"
You should `unset PYTHONPATH` to fix this.
我在我的系统上安装了 Python3 和 Python2.7 以及 macOS,但我真的只想将 Python3 用于几乎所有事情。使用/配置 Python 很新,有其他人遇到过这个吗?
【问题讨论】:
-
如果你想使用 python3,请使用
pip3而不是pip。另外,考虑使用virtualenv。 -
PYTHONPATH 和 virtualenv 的介绍,djangodeployment.com/2016/11/01/virtualenv-demystified
标签: python django python-3.x virtualenv