Matplotlib does not work in PyDev in Eclipse

2011-07-03
2013-03-15
  • Werner Rolf
    Werner Rolf
    2011-07-03

    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: 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 to check the installation like:

    import numpy
    arcpy.AddMessage("NUMPY Version " + numpy.__version__)

    import matplotlib
    arcpy.AddMessage("MATPLOTLIB Version " + matplotlib.__version__)

    I get the following error:
    NUMPY Version 1.6.1rc1
    Traceback (most recent call last):
    print "MATPLOTLIB Version " + matplotlib.__version__
    AttributeError: 'module' object has no attribute '__version__'

    Also the command
    - import pylab as pl

    import pylab as pl
    from matplotlib.pylab import *
    ImportError: No module named pylab

    So even matplotlib is installed properly in the directory "site-packages" (see screenshot attached) it does not work in Eclipse.
    Eclipse points properly as well (see 2nd screenshot attached). As you see I even added the directory matplotlib manually)

    By the way if I let it run in iPython (same installation) it works perfect.

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

    Thanks
    Werner