Using CX_Freeze with Scipy: scipy.special._ufuncs.py

I have problems freezing my program. I narrowed it to a lean module. The program I'm trying to freeze is as follows:

from scipy import signal signal.hann(1000) 

My setup script:

 import sys from cx_Freeze import setup, Executable build_exe_options = {} base = None if sys.platform == "win32": base = "Win32GUI" setup( name = "Some name", version = "1.0", author="My name", description = "My GUI application!", options = {"build_exe": build_exe_options}, executables = [Executable("Script_Name.py", base=base)]) # ^CHANGE THIS NAME!!! 

Here is the image of the error message . I also tried to include scipy.signal in the installation file as

 build_exe_options = {"includes":"scipy.signal"} 

but it was of no use. Please help me.

+6
source share
1 answer

I had a similar problem that could be solved by making sure that:

1 The build directory contains a file named _ufunc.pyd (instead of scipy.special._ufuncs.pyd, as described above). You can achieve this by specifying build_exe_options:

 build_exe_options = { 'packages': ['scipy'], "include_files": [('path2python\\Lib\\site-packages\\scipy\\special\\_ufuncs.pyd','_ufuncs.pyd')]} 

2 Make sure that all dlls used by ufunc.pyd are also in the build directory. In my case, libifcoremd.dll adn libmmd.dll failed. You can check it with dependencywalker

Hope this helps you.

+8
source

Source: https://habr.com/ru/post/956863/


All Articles