我正在尝试在 conda 环境中导入 sklearn,但出现此错误:
ModuleNotFoundError: No module named 'numpy.random.bit_generator'
我正在使用 M1 Mac Pro。请参阅下面的错误代码。看到错误
>>> import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/sklearn/__init__.py", line 82, in <module>
from .base import clone
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/sklearn/base.py", line 17, in <module>
from .utils import _IS_32BIT
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/sklearn/utils/__init__.py", line 23, in <module>
from .class_weight import compute_class_weight, compute_sample_weight
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/sklearn/utils/class_weight.py", line 7, in <module>
from .validation import _deprecate_positional_args
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/sklearn/utils/validation.py", line 26, in <module>
from .fixes import _object_dtype_isnan, parse_version
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/sklearn/utils/fixes.py", line 20, in <module>
import scipy.stats
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/scipy/stats/__init__.py", line 441, in <module>
from .stats import *
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/scipy/stats/stats.py", line 43, in <module>
from . import distributions
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/scipy/stats/distributions.py", line 11, in <module>
from . import _discrete_distns
File "/Users/nikhil/miniforge3/envs/ml/lib/python3.8/site-packages/scipy/stats/_discrete_distns.py", line 19, in <module>
from .biasedurn import (_PyFishersNCHypergeometric,
File "biasedurn.pyx", line 1, in init scipy.stats.biasedurn
ModuleNotFoundError: No module named 'numpy.random.bit_generator'```