PyCharm和外部库

时间:2014-02-19 14:42:17

标签: matplotlib pycharm

我已经开始使用PyCharm IDE,但我无法确定如何在那里管理外部库。例如,PyCharm没有看到matplotlib。在PyCharm的文件管理器中,我清楚地看到了外部库列表,但没有matplotlib。但是,我安装了它,我知道它的位置。

如何将此库添加到PyCharm环境?

3 个答案:

答案 0 :(得分:53)

我建议使用Python虚拟环境。 PyCharm真的很容易。

PyCharm>偏好...>项目口译员> Python口译员

单击“创建虚拟环境”并选择基础解释器。

enter image description here

单击“安装”并安装所需的任何软件包。如果默认存储库不包含必需的库,您还可以添加其他存储库。另一个好处是,您可以看到哪些库具有更新版本并且可以更新。

enter image description here

答案 1 :(得分:5)

我认为解决问题的一种方法是通过File - >在PyCharm中指定你的解释器。设置 - > Python口译员

此设置中还有一个Paths标签,您需要在那里明确添加matplotlib的路径。但对我来说,那里没有列出特殊路径。以下是此选项卡中的路径:

file:// D:/ hg_work / vefw_regression / tools / python / DLLs
file:// D:/ hg_work / vefw_regression / tools / python / Lib
file:// D:/ hg_work / vefw_regression / tools / python / Lib / lib-tk
file:// D:/ hg_work / vefw_regression / tools / python
file:// D:/ hg_work / vefw_regression / tools / python / lib / site-packages(我的matplotlib / numpy和其他东西在这里)
file:// D:/ hg_work / vefw_regression / tools / python / Lib / site-packages / win32
file:// D:/ hg_work / vefw_regression / tools / python / Lib / site-packages / win32 / lib
file:// D:/ hg_work / vefw_regression / tools / python / Lib / site-packages / pythonwin
file:// D:/ Users / svecovs / AppData / Roaming / JetBrains / PyCharm Community Edition 3.0.1 / helpers / python-skeletons
file:// D:/ hg_work / vefw_regression / tools / python / Lib / site-packages / core(由用户添加)

答案 2 :(得分:0)

对于Linux用户来说这是一个解决方案, 首先在终端中写这个命令,

sudo apt-get install python-matplotlib

现在你已经完成了,你将能够在File>>> settings>>项目解释器中看到matplotlib。 Image