Search code examples
pythonscipy

ModuleNotFoundError: No module named scipy.special._cdflib with SciPy-1.13.0


platform:windows server 2019 python:3.12.2 scipy:1.13.0 When I upgraded scipy from 1.12 to 1.13 there was No module named scipy.special._cdflib.This doesn't happen when I use 1.12.0.

Traceback (most recent call last): 
  File "src\predict.py", line 14, in <module> 
    from src.utils.calc_utils import *
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "src\utils\calc_utils.py", line 1, in <module>
    from scipy.interpolate import interp1d
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "scipy\interpolate\__init__.py", line 167, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "scipy\interpolate\_interpolate.py", line 10, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "scipy\special\__init__.py", line 777, in <module>
  File "scipy\\special\\_ufuncs.pyx", line 1, in init scipy.special._ufuncs
ModuleNotFoundError: No module named 'scipy.special._cdflib'

How to solve this problem? Why does this problem occur?


Solution

  • Appenrently this is a known issue in pyinstaller, look at which version you have. In the changelog it states

    Update scipy.special._ufuncs hook for compatibility with SciPy 1.13.0 (add scipy.special._cdflib to hidden imports). (#8394)

    So using version 6.6.0 of pyinstaller might work