-
Notifications
You must be signed in to change notification settings - Fork 201
Incompatible with SciPy 1.9.0, AttributeError on scipy.linalg.pinv2 #236
Copy link
Copy link
Closed
Description
SciPy released version 1.9.0 three days ago, and in that version they removed scipy.linalg.pinv2 [1]. Latest PyKrige (version 1.6.1) tries to access this function at import time, causing an AttributeError. According to SciPy 1.7.0 release notes, scipy.linalg.pinv can replace the usage of scipy.linalg.pinv2 [2].
Steps to reproduce:
- Create a new virtual environment, activate it, and install PyKrige:
python -m venv new_env
. new_env/bin/activate
python -m pip install pykrige- Run python and try to import pykrige:
python -c 'import pykrige'
Result:
$ python -c 'import pykrige'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/path-to-new_env/lib/python3.10/site-packages/pykrige/__init__.py", line 45, in <module>
from .ok import OrdinaryKriging # noqa
File "/path-to-new_env/lib/python3.10/site-packages/pykrige/ok.py", line 28, in <module>
from . import core
File "/path-to-new_env/lib/python3.10/site-packages/pykrige/core.py", line 34, in <module>
P_INV = {"pinv": spl.pinv, "pinv2": spl.pinv2, "pinvh": spl.pinvh}
AttributeError: module 'scipy.linalg' has no attribute 'pinv2'. Did you mean: 'pinv'?
$ pip list
Package Version
---------- -------
numpy 1.23.1
pip 22.0.2
PyKrige 1.6.1
scipy 1.9.0
setuptools 59.6.0
[1] https://docs.scipy.org/doc/scipy/release.1.9.0.html#expired-deprecations
[2] https://docs.scipy.org/doc/scipy/release.1.7.0.html#scipy-linalg-deprecations
Reactions are currently unavailable