Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python installation error no matching distribution found for pyplot

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

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:

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:

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.

like image 345
leela.fry Avatar asked Oct 17 '15 17:10

leela.fry


People also ask

What is import Matplotlib Pyplot in Python?

matplotlib. pyplot is a collection of command style functions that make matplotlib work like MATLAB. Each pyplot function makes some change to a figure: e.g., creates a figure, creates a plotting area in a figure, plots some lines in a plotting area, decorates the plot with labels, etc. In matplotlib.

What is PLT CLF () in Python?

matplotlib.pyplot.clf() Function. The clf() function in pyplot module of matplotlib library is used to clear the current figure.

What is Matplotlib PyLab?

MatPlotLib with Python PyLab is a procedural interface to the Matplotlib object-oriented plotting library. Matplotlib is the whole package; matplotlib. pyplot is a module in Matplotlib; and PyLab is a module that gets installed alongside Matplotlib. PyLab is a convenience module that bulk imports matplotlib.

Could not find a version that satisfies the requirement Python Dev?

The error "Could not find a version that satisfies the requirement" is often caused when you try to install a package using an older version of pip than is required. To solve the error, upgrade your version of pip .


2 Answers

If you try

pip install matplotlib

and it fails, try

pip install --upgrade matplotlib

You might already have the package pre-installed.

like image 114
PYu Avatar answered Sep 22 '22 09:09

PYu


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.

The site I linked you shows prerequisite modules for matplotlib, so make sure you also have those installed.

like image 36
pyman Avatar answered Sep 19 '22 09:09

pyman