2015-10-17 41 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

相關問題