【发布时间】:2016-09-28 03:06:23
【问题描述】:
在上一个项目中,我使用了 python 2.7。新的必须在 python 3.5 中运行,所以我安装了 3.5。我在 Setting-->Python interpreter 中选择 Python 3.5,我得到了Error : Django is not importable in this environment.
然后我尝试运行
pip install django
Requirement already satisfied (use --upgrade to upgrade): django in c:\python27\lib\site-packages
Cleaning up...
路径似乎有问题,我该如何改正?
【问题讨论】:
-
使用项目解释器设置使用 Python 3.5 创建一个新的虚拟环境并在其中安装 Django,通过 PyCharm 的 GUI 或运行 virtualenv 生成的
activate脚本你的终端。请参阅jetbrains.com/help/pycharm/2016.1/…、jetbrains.com/help/pycharm/2016.1/…(如果您不确定自己在做什么,那么完全坚持使用 PyCharm 可能会更容易开始)。 -
pip install django用于 python 2。请使用pip3 install django用于 python 3
标签: python django python-3.x ide pycharm