Error shows when I import matplotlib after installation

I use command pip install matplotlib to install it successfully. But when I type pip list, there is no matplotlib package in the list.

When I try

python2.7 -c 'import matplotlib; print matplotlib.__version__, matplotlib.__file__'

It shows

 1.4.3 /usr/local/lib/python2.7/site-packages/matplotlib/__init__.pyc

But when I try import matplotlib.pyplot as plt in .py file, an error shows

 import matplotlib.pyplot as plt
 ImportError: No module named pyplot

What makew me confused is that when I import matplotlib in python interpreter, no error shows.

I follow to check the installation. Installation seems succeed.

Author: Fantashit

2 thoughts on “Error shows when I import matplotlib after installation

  1. Im a complete newb trying to follow a tutorial. had the same exact error message. try saving your program in a different folder. It worked for me somehow

Comments are closed.