[Numpy-discussion] numpy with mod_python...

Dav Clark dav at alum.mit.edu
Thu Mar 9 11:40:02 CST 2006


So,

This seems like an obvious thing, but there are so many levels of things 
involved that I'd really appreciate some guidance.

'import numpy' works fine most places, but it strangely fails when done 
from ../site-packages/numpy.  

That, I don't care so much, but I found that problem in persuing why 'import 
numpy' fails when called from a script within mod_python.  In this case, the 
cwd is '/'.

The precise error (in both cases) is:


---
/usr/lib/python2.4/site-packages/numpy/core/__init__.py
     20
     21 __all__ = ['char','rec','memmap','ma']
---> 22 __all__ += numeric.__all__
     23 __all__ += oldnumeric.__all__
     24 __all__ += defmatrix.__all__

NameError: name 'numeric' is not defined
---

The obvious solution / hack to get this working in mod_python is to simply 
os.chdir() before running an import.  Except that doesn't work.

So, ideas about how to hack mod_python or numpy - or even better how to _fix_ 
numpy - would be greatly appreciated!

Thanks,
-- 
Dav Clark
Holistic Neuroscientist
917-544-8408
))<>((




More information about the Numpy-discussion mailing list