I'm not sure what MAMP is. Usually this problem is because matplotlib is trying to import a GUI toolkit and the windowing environment is not available from the web server. Try setting the matplotlib backend to "Agg", by putting this at the top of the file:

   import matplotlib
   matplotlib.use("Agg")

Mike

On 11/14/2011 05:13 AM, Paul de Beurs wrote:
Hey,

I work with Mac OSX 10.7.2
I have a probleem. From the IDLE this little program works fine:
#!/usr/bin/python
import numpy
import matplotlib
print "Content-Type: text/plain\n"
print matplotlib.__version__

The output is:
Content-Type: text/plain

1.1.0

Starting this program from MAMP gives me:  Internal Server Error

First I change the program into:
#!/usr/bin/python
import numpy
import matplotlib
print "Content-Type: text/plain\n"
print 'No error'

But starting this program from MAMP also gives me:  Internal Server Error

Now I change my program into:
#!/usr/bin/python
import numpy
##import matplotlib
print "Content-Type: text/plain\n"
print 'No error'

Now starting this program from MAMP gives me:  No error

So the import of mapplotlib causes this troubles. I don't have these problems with the import of numpy.

Can someone help me with this problem?





------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1


_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to