我想在我现有的python django项目中使用Intellij Idea,该项目是在ubuntu的虚拟环境中构建的.如何配置Intellij Idea以使用虚拟环境的库?
我想在我现有的python django项目中使用Intellij Idea,该项目是在ubuntu的虚拟环境中构建的.如何配置Intellij Idea以使用虚拟环境的库?
根据来自PyCharm的documentation:
在"添加Python解释器"对话框的左侧窗格中, Select VirtualEnvironment.以下操作取决于
如果 Select 了现有环境:
单击确定以完成任务.
将现有虚拟环境添加到可用口译员列表中
更多信息,请点击这link.
Well I solved the above problem. I have added virtualenv folder's python to project sdk. The virtualenv directory's python( for example venv/bin/python2.7) needs to be added to Intellij Idea project path. Example: need to go to file>project structure (intellij Idea)
在Project SDK中按new,向virtualenv的python目录添加新路径,如下所示:
Go to Modules>Dependencies and set your module sdk to Python SDK which is marked on this picture:
点击Django点(图像旁边标记的选项),然后设置Django project root
、Settings
、Manage Script
,如下所示:
现在按ok,最后查看项目设置:
现在需要运行该项目.