Bug report #21161

scipy import in PyQGIS throws traceback

Added by Jochen Schwarze about 5 years ago. Updated about 5 years ago.

Status:Rejected
Priority:High
Assignee:-
Category:PyQGIS Console
Affected QGIS version:3.4.0 Regression?:Yes
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:wontfix
Crashes QGIS or corrupts data:No Copied to github as #:28979

Description

This affects both PyQGIS console and plugins in 2.18.28 LTR, both installed from OSGeo4W and standalone installer. I think this is a regression, because I did not observe this in 2.18.26 LTR.
Note that I selected QGIS 3.4.0 as affected version because LTR is not available here and without this this issue cannot be submitted. QGIS 3 is NOT AFFECTED!

Trying to

import scipy

throws the following traceback:

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGEO4~1\apps\Python27\lib\site-packages\scipy\__init__.py", line 61, in <module>
from numpy._distributor_init import NUMPY_MKL # requires numpy+mkl
ImportError: cannot import name NUMPY_MKL

In the LTR installed via OSGeo4W I can downgrade python-scipy library from 0.19.0-1 to 0.14.0-1. This attempt seems to work at first sight, but when I try to

from scipy import cluster

I get another traceback:

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGEO4~1\apps\Python27\lib\site-packages\scipy\cluster\__init__.py", line 27, in <module>
from . import vq, hierarchy
File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGEO4~1\apps\Python27\lib\site-packages\scipy\cluster\hierarchy.py", line 176, in <module>
import scipy.spatial.distance as distance
File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGEO4~1\apps\Python27\lib\site-packages\scipy\spatial\__init__.py", line 91, in <module>
from .qhull import *
File "C:/OSGEO4~1/apps/qgis-ltr/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.

As a consequence none of my plugins that make use of scipy.cluster work. It crashes the plugins loaded at startup, thats because I marked 'Crashes QGIS or corrupts data'.

History

#1 Updated by Nyall Dawson about 5 years ago

  • Resolution set to wontfix
  • Status changed from Open to Rejected

Qgis 2.18 is no longer supported

Also available in: Atom PDF