在eclipse中导入matplotlib

发布于 2024-12-20 20:02:33 字数 191 浏览 3 评论 0原文

我在 Ecplise (Python 2.7) 中运行 pydev。 Numpy 和 tkinter 工作正常,但我安装了 matplotlib,并且由于某种原因,当我尝试

from matplotlib import *

时,我得到的响应是找不到。我将带有模块的文件夹添加到 PythonPath 但不断收到相同的消息。我做错了什么?

I'm running pydev in Ecplise (Python 2.7). Numpy and tkinter work fine, but I installed matplotlib and for some reason when I try

from matplotlib import *

I get the response it's not found. I added the folder with the module to PythonPath but keep getting same message. What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

百善笑为先 2024-12-27 20:02:33

来自pydev教程(根据我的经验,与您的问题相关的两种最常见的情况):

1)

最常见的错误是环境变量有问题
从生成 Eclipse 的 shell 中使用,对于某些人来说
原因是当获取一个解释器的变量时,它会收集
来自另一个解释器的信息(从而混合了解释器和
实际的库)。

2)

如果您向 python 安装添加某些内容,则需要
将其手动添加为系统 PYTHONPATH 中的“新文件夹”(如果是
仍然不在 PYTHONPATH 中的文件夹下)或(推荐)删除
您的口译员并再次添加
,然后按“应用”。

from pydev tutorial (in my experience, the two most common cases related with your problem):

1)

The most common error is having a problem in the environment variables
used from the shell that spawned Eclipse, in a way that for some
reason when getting the variables of one interpreter, it gathers the
info from another interpreter (thus mixing the interpreter and the
actual libraries).

2)

If you add something to your python installation, you need to either
add it manually as a 'new folder' in the System PYTHONPATH (if it's
still not under a folder in the PYTHONPATH) or (recommended) remove
your interpreter and add it again
, then, press apply.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文