简体   繁体   English

PyCharm 项目中的外部库是什么?

[英]What are the External Libraries in a PyCharm project?

I'm a bit confused on this and can't find a satisfactory answer searching elsewhere - everything is about using external libraries in some way or another.我对此有点困惑,在其他地方找不到令人满意的答案 - 一切都是关于以某种方式使用外部库。

In my PyCharm projects, I've got your project root directory, which contains a venv .在我的 PyCharm 项目中,我有你的项目根目录,其中包含一个venv This venv of course contains the python executable relative to the project, as well as the relevant site-packages and modules I've downloaded via pip or whatever.这个venv当然包含与项目相关的 python 可执行文件,以及我通过pip或其他方式下载的相关site-packages和模块。

But there's always an External Libraries section, that has it's own Python executable, venv , .gitignore , site-packages , etc.但总有一个External Libraries部分,它有自己的Python 可执行文件、 venv.gitignoresite-packages等。

Is this normal?这是正常的吗? What's the purpose of having two venvs in the same project?在同一个项目中拥有两个venvs的目的是什么?

Thanks!谢谢!

You only have one venv normally in your Project The other Python Executable should be the global one.您的项目中通常只有一个 venv 另一个 Python 可执行文件应该是全局的。 Normally you use a venv to keep track of the needed Packages for this specific project.通常,您使用 venv 来跟踪此特定项目所需的包。 So that you don't confuse other Packages with other projects or have dependency/Version Issues这样您就不会将其他包与其他项目混淆或存在依赖项/版本问题

If you want you can also use the global Installation of Python which would not create a venv如果您愿意,还可以使用不会创建 venv 的 Python 的全局安装

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM