在现有的virtualenv中使用IntellijIdea [英] Using IntellijIdea within an existing virtualenv
问题描述
对于旧版本:
我解决了上述问题。我已经将virtualenv文件夹的python添加到项目sdk。需要将virtualenv目录的python(例如venv / bin / python2.7)添加到Intellij Idea项目路径中。示例:需要转到文件>项目结构(intellij Idea)
在项目SDK 中按新增功能,并添加新的路径到virtualenv的python目录,如下所示:
转到模块>依赖关系,并将您的模块sdk设置为在此标记的Python SDK图片:
点击 Django (在下一个图像中标记选项),并设置 Django项目根
,设置
,管理脚本
像这样:
现在按OK和项目设置的最终外观:
现在需要运行项目。
对于Pycharm 2016及更高版本
将现有的虚拟环境添加到列表中的可用口译员
- 在项目解释器页面中,单击。
- 在下拉列表中,选择添加本地。
- 在打开的选择Python解释器对话框中,选择所需的Python可执行文件,在虚拟环境文件夹内,然后点击确定。
转到这个 li nk 获取更多信息。
I want to use Intellij Idea within my existing python django project which was built within a virtual environment in ubuntu. How do I configure Intellij Idea to use the libraries of the virtual environment?
For Older versions:
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)
press new in Project SDK, and add new path to virtualenv's python directory like this:
Go to Modules>Dependencies and set your module sdk to Python SDK which is marked on this picture:
Click on Django (option marked in next the image) and set Django project root
, Settings
,Manage Script
like this:
Now press ok and final look of the Project settings:
Now need to run the project.
For Pycharm 2016 and later
To add an existing virtual environment to the list of available interpreters
- In the Project Interpreter page, click .
- In the drop-down list, choose Add local.
- In the Select Python Interpreter dialog box that opens, choose the desired Python executable, located inside the virtual environment folder, and click OK.
Go to this link for more information.
这篇关于在现有的virtualenv中使用IntellijIdea的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!