我在虚拟环境中创建了一个Django项目,venv
像往常一样被PyCharm自动激活。一切都很好,但是当我把我的项目放入另一个文件夹时,项目解释器的设置由于旧的解释器路径而损坏。
所以现在,当我为解释器提供一个新的路径(当然,还有激活的venv
)时,python
从2.7版本的基本系统位置运行,而不是从venv运行。在
检查此项:
archeski@archeski-Inspiron-5558:~/Source/ecom/ecom$ source venv/bin/activate
(venv) archeski@archeski-Inspiron-5558:~/Source/ecom/ecom$ python --version
Python 2.7.15rc1
(venv) archeski@archeski-Inspiron-5558:~/Source/ecom/ecom$ python -c "import sys; print sys.executable"
/usr/bin/python
大约半年前在Windows10上也发生了同样的事情,解决方案只是从头开始在PyCharm中创建一个项目,然后移动所有源代码、db等。 现在,我正在运行Ubuntu 18.04
相关问题 更多 >
编程相关推荐