Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I have "ModuleNotFoundError: No module named 'scipy.special.cython_special'" when I don't even use cython?

I used pyinstaller to generate an executable for a python script, and when trying to run the executable I get the error ModuleNotFoundError: No module named 'scipy.special.cython_special'. I'm not sure where this is coming from, or how to fix it. My executable takes in one argument and returns a list. Any help is appreciated!

like image 727
Katherine Avatar asked Jun 25 '20 17:06

Katherine


2 Answers

I had this error after freezing a program that used scipy version 1.5.0 but I changed the version to 1.4.1 (which I had used with an earlier virtual environment) and the error disappeared.

like image 112
profTC Avatar answered Sep 20 '22 01:09

profTC


I'm getting the same error, and not exactly sure what causes it or why pyinstaller doesn't find that dependency, but you can fix it by adding 'scipy.special.cython_special' to your pyinstaller myapp.spec file like this:

a = Analysis(['/Users/Name/path/to/mystartupfile.py'],
             pathex=['/Users/Name/...'],
             binaries=[],
             datas=[('data')],
             hiddenimports=['scipy.special.cython_special'],
             hookspath=['/Users/Name..../hooks'],
             runtime_hooks=[],
             excludes=['IPython', 'FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
like image 26
Jayme Gordon Avatar answered Sep 22 '22 01:09

Jayme Gordon