-
Hi Looks like the issue already reported in #3061 and #4423 is back with Details:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
this was a bug in cython which has been fixed: cython/cython#1720 I'd suggest upgrading scikit-learn |
Beta Was this translation helpful? Give feedback.
-
Maybe I should consider upgrading the version of |
Beta Was this translation helpful? Give feedback.
-
You can reproduce this without pytest: python -W error -c 'import sklearn.utils' it's likely that a warning was hidden which is now shown -- the warning is correct though the reason this can happen is due to prebuilt wheels, wheels are never rebuilt on pypi after release for example, I can install scikit-learn==0.20.4 (the last version I can see this reproducing on) and show the same problem: $ pip install scikit-learn==0.20.4
Collecting scikit-learn==0.20.4
Downloading scikit_learn-0.20.4-cp36-cp36m-manylinux1_x86_64.whl (5.4 MB)
|████████████████████████████████| 5.4 MB 2.7 MB/s
Requirement already satisfied: numpy>=1.8.2 in ./venv/lib/python3.6/site-packages (from scikit-learn==0.20.4) (1.19.2)
Requirement already satisfied: scipy>=0.13.3 in ./venv/lib/python3.6/site-packages (from scikit-learn==0.20.4) (1.5.2)
Installing collected packages: scikit-learn
Attempting uninstall: scikit-learn
Found existing installation: scikit-learn 0.21.0
Uninstalling scikit-learn-0.21.0:
Successfully uninstalled scikit-learn-0.21.0
Successfully installed scikit-learn-0.20.4
WARNING: You are using pip version 20.2.1; however, version 20.2.3 is available.
You should consider upgrading via the '/tmp/venv/bin/python -m pip install --upgrade pip' command.
$ python -Werror -c 'import sklearn.utils'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/venv/lib/python3.6/site-packages/sklearn/__init__.py", line 64, in <module>
from .base import clone
File "/tmp/venv/lib/python3.6/site-packages/sklearn/base.py", line 14, in <module>
from .utils.fixes import signature
File "/tmp/venv/lib/python3.6/site-packages/sklearn/utils/__init__.py", line 12, in <module>
from .murmurhash import murmurhash3_32
File "sklearn/utils/murmurhash.pyx", line 19, in init sklearn.utils.murmurhash
ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__ without pytest |
Beta Was this translation helpful? Give feedback.
-
also the only way this could be triggered by default is you've upgraded warnings to errors (likely with |
Beta Was this translation helpful? Give feedback.
-
The change on warnings handling was the missing piece (I missed it in the change log); now everything make sense. Thanks for the explanation, and sorry for the noise :/ |
Beta Was this translation helpful? Give feedback.
this was a bug in cython which has been fixed: cython/cython#1720
I'd suggest upgrading scikit-learn