Matplotlib and WSGI / mod_python do not work on Apache

Everything works as a Django development server. On Apache, the django application also works, except when using matplotlib. Here is the error I get:

No module named multiarray.

Exception Type: ImportError 
Exception Value: No module named multiarray 
Exception Location: /usr/share/pyshared/numpy/core/numerictypes.py in <module>, line 81 
Python Executable: /usr/bin/python 
Python Version: 2.6.4 

Both operators work in the python shell: import numpy.core.multiarray and import multiarray. Any ideas? Thanks

When I look at numpy files, I found a multiarray module that has the extension "so". I assume mod_python is not reading these files.

+5
source share
2 answers

The problem is resolved. Here is what I did.

First of all, before I received the import error:

"There is no module named multiarray."

, :

": /some/dir/.matplotlib; MPLCONFIGDIR matplotlib"

pyshared PythonPath, , .

, :

pyshared PythonPath.

matplotlib :

import os
os.environ['HOME']='/some/writable/dir'

, matplotlib.pyplot pylab, :

import matplotlib
matplotlib.use('Agg') 
# 'Agg' or whatever your backend is.

.

! python2.5. , 2.6.

+8

Win32 ( pyd ISAPI_WSGI (IIS)) py2.6.5 py2.5. , Python, . . .

+1

All Articles