2015-10-17 439 views
3

我试图运行此程序Python安装错误没有匹配的分布发现pyplot

import matplotlib.pyplot as plt 
import numpy 

plt.plot([1, 2, 3],[5, 7, 4]) 
plt.show() 

我收到一条错误消息: 导入错误:没有名为pyplot

模块我已经在Windows上安装matplotlib 8 64位,Python的2.7与来自bash的PIP命令和我也更新它,得到这个消息的结果:

[email protected]:~$ C:/Python27/Scripts/pip install --upgrade matplotlib 
Requirement already up-to-date: matplotlib in c:\python27\lib\site-packages 
Requirement already up-to-date: pyparsing>=1.5.6 in c:\python27\lib\site-packages\pyparsing-2.0.3-py2.7-win32.egg (from matplotlib) 
Requirement already up-to-date: numpy>=1.6 in c:\python27\lib\site-packages (from matplotlib) 
Requirement already up-to-date: pytz in c:\python27\lib\site-packages\pytz-2015.6-py2.7.egg (from matplotlib) 
Requirement already up-to-date: python-dateutil in c:\python27\lib\site-packages\python_dateutil-2.4.2-py2.7.egg (from matplotlib) 
Requirement already up-to-date: six>=1.4 in c:\python27\lib\site-packages\six-1.10.0-py2.7.egg (from matplotlib) 

当我试图在失速pyplot我得到这个按摩:

[email protected]:~$ C:/Python27/Scripts/pip install pyplot 
Collecting pyplot 
    Could not find a version that satisfies the requirement pyplot (from versions:) 
No matching distribution found for pyplot 

如果任何人有一个想法如何安装pyplot,为什么我的分布不匹配,我很欣赏你的帮助。

+0

我从wheel文件安装matplotlib,就像在Windows上一样,我从来没有能够从pip成功安装64位版本。所以请尝试下载.whl文件并从中进行安装。 – BlivetWidget

回答

4

尝试从here重新安装matplotlib。不要紧,如果你在一台64位计算机上(我也是)。重要的是你安装了哪个版本的Python?如果您安装了32位(建议因为处理起来更容易),那么您仍然安装32位版本的模块。

我链接到的网站显示了matplotlib的必备模块,因此请确保您也安装了这些模块。

+0

发布了大量资源 – Anekdotin

相关问题