PyCharm 使用 PyCharm 创建的 virtualenv 和依赖项 [英] PyCharm to use virtualenv and dependencies created by PyCharm

查看:51
本文介绍了PyCharm 使用 PyCharm 创建的 virtualenv 和依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用命令提示符创建了一个 virtualenv 并安装了我的所有依赖项.如何让 PyC​​harm 使用虚拟环境 &通过命令提示符创建的依赖项?

I have created a virtualenv using command prompt and have installed all my dependencies. How can I make PyCharm use the virtual env & dependencies created via command prompt?

推荐答案

你应该在 PyCharm 中链接 virtualenv.
为此,请访问:

You should link the virtualenv in PyCharm.
In order to do this, go to:

File -> Settings -> Project -> Project Interpreter

在这里,在窗口的右上角,点击齿轮图标并选择添加.
然后,选择现有环境选项并在您的计算机中导航,直到找到适用于您的 virtualenv 的 python.exe.

Here, in the top right corner of the window, click on the gear icon and choose Add.
Then, choose Existing environment option and navigate in your computer until you find the python.exe for your virtualenv.

然后点击确定确认修改.这应该足够了.

Than confirm modifications clicking Ok. This should be enough.

如果您想在 PyCharm 配置中使用它,请不要忘记在 Python Interpreter 选项中选择它.

If you want to use it in a PyCharm configuration, please do not forget to choose it in the Python Interpreter option.

这篇关于PyCharm 使用 PyCharm 创建的 virtualenv 和依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆