5
votes

I seem to have a problem that is in parts very similar to the one mentioned here:
Python with eclipse import problem

But unfortunatly just in parts otherwise that would have solved mine as well.

I use Eclipse SDK, Version: 3.7.0 with PyDev 101. Furthermore I have installed numpy-1.6.1rc1-win32-superpack-python2.6.exe and matplotlib-1.0.1.win32-py2.6.exe as noted here: http://matplotlib.sourceforge.net/users/installing.html

I have rebuild all the packages and looks the site-packages are listed.

(by the way as you see it is an Python version installed with ArcGIS )

If I test a script for instance a very simple one like:

import numpy 
import matplotlib
import pylab as pl

I get the following error in Eclipse: import matplotlib import pylab as pl from matplotlib.pylab import * ImportError: No module named pylab

Even though the interpreter for Pydev is pointing to the appropriate version of python and matplotlib is installed properly in there (site-packages) it does not work in Eclipse. In iPython it works perfect.

What still needs to be done to get matplotlib work in Eclipse?

Thanks a lot!

Werner

2
Are you sure that pylab is part of matplotlib? - Artium
OMG, I just noticed that you linked to a question I asked. - Artium
Well at least it comes along with matplotlib, is being installed with it and seems to be quite is essential. Anyway, how did you solve the problem with #@PydevCodeAnalysisIgnore? Does that work with windows? What exactly did you do? - Werner
Using #@PydevCodeAnalysisIgnore did help. You need to put it a the beginning of your py file. This will disable the static analysis of all error, so this is not a good solution, but it is the only one I know. - Artium

2 Answers

2
votes

pylab is in matplotlibs namespace, so this should work:

import matplotlib.pylab as pylab
2
votes

I found that turning off interactive move and then calling show worked.

import matplotlib.pyplot as plt

#...your code...

plt.ioff()
plt.show()