Python安装错误找不到与pyplot匹配的分布
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33189458/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Python installation error no matching distribution found for pyplot
提问by leela.fry
I am trying to run this program
我正在尝试运行这个程序
import matplotlib.pyplot as plt
import numpy
plt.plot([1, 2, 3],[5, 7, 4])
plt.show()
I am getting an error message: ImportError: No module named pyplot
我收到一条错误消息:ImportError: No module named pyplot
I have installed matplotlib on Windows 8 64-bit, Python 2.7 with pip command from bash and I also updated it, got this message as a result:
我已经使用来自 bash 的 pip 命令在 Windows 8 64 位 Python 2.7 上安装了 matplotlib 并且我也更新了它,结果得到了这条消息:
Aneta@AKZ-5K-Computer:~$ 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)
When I tried to install pyplot I got this massage:
当我尝试安装 pyplot 时,我得到了这个按摩:
Aneta@AKZ-5K-Computer:~$ 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
If anyone has an idea how to install pyplot and why my distribution is not matching, I appreciate your help.
如果有人知道如何安装 pyplot 以及为什么我的发行版不匹配,我感谢您的帮助。
采纳答案by pyman
Try reinstalling matplotlib from here. It doesn't matter if you're on a 64 bit computer (I am as well). What matters is which version of Python did you install? If you installed the 32-bit (recommended as it's somewhat easier to deal with), then you still install the 32-bit versions of modules.
尝试从这里重新安装 matplotlib 。如果您使用的是 64 位计算机(我也是),这并不重要。重要的是您安装了哪个版本的 Python?如果您安装了 32 位(推荐,因为它更容易处理),那么您仍然安装 32 位版本的模块。
The site I linked you shows prerequisite modules for matplotlib, so make sure you also have those installed.
我链接到您的站点显示了 matplotlib 的必备模块,因此请确保您也安装了这些模块。
回答by Aditya Kuppili
Or what you can do is just try
pip install matplotlib
.
Then import matplotlib.pyplot to make get the pyplot data. matplotlib is a module with pyplot inside it so you can access pyplot easily.
或者你可以做的就是尝试
pip install matplotlib
。然后导入 matplotlib.pyplot 来获取 pyplot 数据。matplotlib 是一个包含 pyplot 的模块,因此您可以轻松访问 pyplot。
回答by PYu
If you try
如果你试试
pip install matplotlib
and it fails, try
它失败了,试试
pip install --upgrade matplotlib
You might already have the package pre-installed.
您可能已经预先安装了该软件包。