Question

I am using Python 2.6, Excel 2007 Professional and the latest version of PyXLL. When loading a module in PyXLL that has

import scipy

An exception is thrown and the module is not loaded. Has anyone been able to load Scipy in PyXLL? Could it be a versioning problem? The exception thrown is:

2010-12-21 17:21:30,915 - ERROR : Error importing 'options': DLL load failed: A dynamic link library (DLL) initialization routine failed.
2010-12-21 17:21:30,915 - ERROR : Traceback (most recent call last):
2010-12-21 17:21:30,915 - ERROR :   File "pyxll", line 402, in _open
2010-12-21 17:21:30,915 - ERROR :   File "C:\Dev\libs\pyxll\examples\options.py", line 15, in <module>
2010-12-21 17:21:30,915 - ERROR :     import scipy
2010-12-21 17:21:30,915 - ERROR :   File "C:\Python26\lib\site-packages\scipy\__init__.py", line 78, in <module>
2010-12-21 17:21:30,915 - ERROR :     from numpy import show_config as show_numpy_config
2010-12-21 17:21:30,915 - ERROR :   File "C:\Python26\lib\site-packages\numpy\__init__.py", line 138, in <module>
2010-12-21 17:21:30,915 - ERROR :     import add_newdocs
2010-12-21 17:21:30,915 - ERROR :   File "C:\Python26\lib\site-packages\numpy\add_newdocs.py", line 9, in <module>
2010-12-21 17:21:30,930 - ERROR :     from lib import add_newdoc
2010-12-21 17:21:30,930 - ERROR :   File "C:\Python26\lib\site-packages\numpy\lib\__init__.py", line 4, in <module>
2010-12-21 17:21:30,930 - ERROR :     from type_check import *
2010-12-21 17:21:30,930 - ERROR :   File "C:\Python26\lib\site-packages\numpy\lib\type_check.py", line 8, in <module>
2010-12-21 17:21:30,930 - ERROR :     import numpy.core.numeric as _nx
2010-12-21 17:21:30,930 - ERROR :   File "C:\Python26\lib\site-packages\numpy\core\__init__.py", line 5, in <module>
2010-12-21 17:21:30,930 - ERROR :     import multiarray
2010-12-21 17:21:30,930 - ERROR : ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
Was it helpful?

Solution

I suspect this is because you are using the Enthought distribution of NumPy. The current version available has a problem that means it cannot be embedded in Excel.

To fix this, you need to remove the manifest resources from the numpy pyd files using cff explorer or any other PE editor.

Enthought are aware of this and are looking at the problem.

The version you can download from the numpy website works fine with PyXLL.

If you have any other issues, feel free to email support@pyxll.com or post on the PyXLL forum.

Regards,

Tony

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top