6

I have installed matplotlib (v. 1.0.1) which works with iPython quite good. But if I insert the same script in ArcGIS 10 or Eclipse 3.7.0 (with PyDev) I get always errors. As I consider to use matplotlib to create graphs with ArcGIS Python Scripts developed in Eclipse thats both pretty unfortunate - so far eclipse works quite well for ArcGIS 10.

F.i. I tested this one: http://matplotlib.sourceforge.net/examples/api/unicode_minus.html In iPython it works perfect.

In Eclipse I get this error: import matplotlib.pyplot as plt ImportError: No module named pyplot

And in ArcGIS I get this one: Running script Script1... : bad screen distance "640.0" Failed to execute (Script1).

Do I still have something to configure?


I have tested several other things and posted in other forums as well (like ESRI). As there seem to be no solution to the problem maybe someone does have a recommendation about which other tool might be suitable to create graphs while running python with ArcGIS 10. Besides regular pie and column charts I need in particular the possibility to create star plots/ radar charts / amoeba diagram - most likely something like:

http://matplotlib.sourceforge.net/examples/pylab_examples/polar_bar.html

1
  • Could be a pythonpath issue if you have multiple installations of python. Your eclipse may use a different one. This has always been a headache for me. Make sure your eclipse is configured with the "right" /arcgis-shipped python interpreter (you can set up different ones against different installations and libraries).
    – ako
    Commented Aug 1, 2011 at 6:12

2 Answers 2

2

I can't be sure, but if you have setuptools, you can use easy_install. It may be as simple as downloading the egg (For some reason I had issues with downloading/installing directly with easy_install) and installing it using your chosen Python interpreter, like so:

C:\Python26\ArcGIS10.0\python.exe -m easy_install C:\Path\To\Egg\matplotlib-1.0.1_r0-py2.6-win32.egg

As long as you have the required dependencies, this should resolve your import error with your specified Python interpreter.

I'm clueless about the "bad screen distance" error.

1

I could be corrected, but I think your issue is that ESRI installs its own version of python, so you have to install matplotlib to python shipped with ESRI products.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.