gpt4 book ai didi

scikit-learn - 导入错误 : No module named 'sklearn.__check_build._check_build'

转载 作者:行者123 更新时间:2023-12-04 17:38:13 31 4
gpt4 key购买 nike

ModuleNotFoundError                       Traceback (most recent call last)
~\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build\__init__.py in <module>()

43 try:
---> 44 from ._check_build import check_build # noqa
45 except ImportError as e:

ModuleNotFoundError: No module named 'sklearn.__check_build._check_build'



在处理上述异常的过程中,又发生了一个异常:
ImportError                               Traceback (most recent call last)
<ipython-input-1-f14d678f34eb> in <module>()



1 from keras.models import Sequential
2 from keras.layers import Dense, Dropout
----> 3 from sklearn.model_selection import train_test_split
4 import numpy
5 import pandas as pd

~\AppData\Roaming\Python\Python36\site-packages\sklearn\__init__.py in <module>()
61 # process, as it may not be compiled yet
62 else:
---> 63 from . import __check_build
64 from .base import clone
65 from .utils._show_versions import show_versions

~\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build\__init__.py in <module>()
44 from ._check_build import check_build # noqa
45 except ImportError as e:
---> 46 raise_build_error(e)

~\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build\__init__.py in raise_build_error(e)
39 to build the package before using it: run `python setup.py install` or
40 `make` in the source directory.
---> 41 %s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
42
43 try:

ImportError: No module named 'sklearn.__check_build._check_build'



Contents of C:\Users\owaisaaa\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build:
setup.py _check_build.cp36-win32.pyd__init__.py
__pycache__

似乎 scikit-learn 没有正确构建。

如果您已经从源代码安装了 scikit-learn,请不要忘记
在使用之前构建包:运行 python setup.py install或者 make在源目录中。

如果您使用过安装程序,请检查它是否适合您
Python 版本、您的操作系统和您的平台。

我最近在同一台机器上使用了pycharm并下载了其中的包。从那一刻起,我的 jupyter 笔记本中出现了上述错误。

最佳答案

尝试安装 scipy 并重新启动 python shell

关于scikit-learn - 导入错误 : No module named 'sklearn.__check_build._check_build' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55665923/

31 4 0