在PyCharm Professional 4中添加外部库 [英] Adding external libraries in PyCharm Professional 4
问题描述
我正在尝试将外部库添加到我的项目中,但是在PyCharm 4(专业版)中似乎没有办法这样做.我发现了几个类似的问题,并且答案都可以接受,但是这些问题似乎只适用于较旧的PyCharm版本.
I'm trying to add external libraries to my project, but there seems no way to do so in PyCharm 4 (Professional). I found several similar questions with accepted answers, however those seem only work on older PyCharm versions.
这是一个示例: PyCharm和外部库
有人知道如何在PyCharm 4 Professional中为外部Python软件包和模块添加路径吗?
Does anyone know how to add paths for external Python packages and modules in PyCharm 4 Professional?
推荐答案
使用File -> Default Settings -> Project Interpreter
下的最新PyCharm版本(2018.1),您可以选择要使用的解释器(操作系统默认设置或您可能已手动安装的任何其他发行版).
With the latest PyCharm version (2018.1) under File -> Default Settings -> Project Interpreter
you can select which interpreter to use (OS default or any other distribution you may have manually installed).
中间的框列出了当前安装的所有软件包,而底部的+
按钮允许从公共存储库安装软件包.
The box in the middle lists all the packages currently installed, while the +
button at the bottom allow to install packages from public repositories.
如果要添加自定义软件包,则必须手动指定路径:
If you want to add custom packages you have to manually specify the path:
选择解释器,然后单击显示所选解释器的路径"
Select the interpreter and click on "Show paths for the selected interpreter"
添加新模块的路径
这篇关于在PyCharm Professional 4中添加外部库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!