I have ran into this during exporting my script (which uses numpy
and scipy
libraries) via py2exe
:
Traceback (most recent call last):
File "imPok.py", line 3, in <module>
File "scipy\misc\__init__.pyc", line 49, in <module>
File "scipy\special\__init__.pyc", line 603, in <module>
File "scipy\special\basic.pyc", line 18, in <module>
File "scipy\special\orthogonal.pyc", line 101, in <module>
File "scipy\linalg\__init__.pyc", line 188, in <module>
File "scipy\linalg\_decomp_update.pyc", line 12, in <module>
File "scipy\linalg\_decomp_update.pyc", line 10, in __load
File "scipy/linalg/_decomp_update.pyx", line 1, in init scipy.linalg._decomp_update (scipy\linalg\_decomp_update.c:35768)
ImportError: No module named cython_blas
Tried:
scipy
dependencies - that worked, i.e. the trouble is in cooperation between scipy
and py2exe
.Questions:
Appendix:
These are the problematic lines:
from scipy.misc import imread
import numpy as np
I actually haven't ask for scipy.linalg
and scipy.special
and yet the py2exe
wants them.
I ran into this problem today, and found a more thorough solution from here.
opts = {"py2exe": {
"includes": ['scipy', 'scipy.integrate', 'scipy.special.*','scipy.linalg.*']}}
Then, in your setup.py script, use:
setup(options=opts,windows=['script.py'])
scipy.misc
must have scipy.linalg.cython_blas
as a dependency. To solve this include the following package in your py2exe setup script at the "options > include" level:
scipy.linalg.cython_blas
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With