6

I'm trying to install matplotlib under Windows Vista. Both python itself and numpy are working for me.

I installed matplotlib via the executable basemap-1.0.2.win32-py2.7 and followed the official instructions. But running from matplotlib import * gives me the following error:

No module named matplotlib

Any ideas how to get matplotlib working?

5 Answers 5

16

you can install by pip install matplotlib

Make sure that you already installed setuptools, numpy, python-dateutil, pytz, pyparsing, and cycler before that.

Sign up to request clarification or add additional context in comments.

2 Comments

hi, I installed all the tools you listed from setuptools to cycler and then I did pip install matplotlib but I get this error Command "python setup.py egg_info" failed with error code 1. Any ideas?
I executed pip install --upgrade setuptools from a command prompt with administrator rights and after that pip install matplotlib worked fine for me
9

basemap is not the installer for matplotlib.
basemap is a library of the matplotlib toolkit for plotting 2D data on maps, you need to indepently install matplotlib to use it.

You can get matplotlib from here

1 Comment

And to update MPL on windows, see matplotlib.org/faq/installing_faq.html (bottom of the page).
0
from pylab import * 

This works on a proper the default scipy/pylab/matplotlib setup. And to get you started:

> hist(randn(10000)) 
> show()

Matplotlib is a part of the pylab suite

Comments

0

If you are installing matplotlib under windows using anaconda. Here are the steps..

I am using Anaconda 1.8.7

  1. Goto your Anaconda Navigator and choose Environments
  2. Click on the arrow and choose Open terminal
  3. Type conda install matplotlib

That should do the trick. For specific versions and to install onto specific environments within annaconda you can utilise the = and -n / name option

https://conda.io/docs/commands/conda-install.html Matplotlib Installation using command prompt / Annaconda Terminal

Comments

-1

Open Command Prompt

C:\Users\Uname>python -m pip install matplotlib

Matplotlib requires some of the following dependencies:

FreeType libpng NumPy setuptools cycler dateutil kiwisolver pyparsing

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.