Scikit learn FileNotFoundError:使用jupyter笔记本导入sklearn时找不到模块

Scikit learn FileNotFoundError:使用jupyter笔记本导入sklearn时找不到模块,scikit-learn,jupyter-notebook,Scikit Learn,Jupyter Notebook,当我尝试在jupyter笔记本中导入sklearn时,我收到如下错误消息: FileNotFoundError Traceback (most recent call last) <ipython-input-2-ae13d4c4c2fb> in <module> 1 # Scikit-Learn ≥0.20 is required ----> 2 import sklearn 3 assert

当我尝试在jupyter笔记本中导入sklearn时,我收到如下错误消息:

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-2-ae13d4c4c2fb> in <module>
      1 # Scikit-Learn ≥0.20 is required
----> 2 import sklearn
      3 assert sklearn.__version__ >= "0.20"

D:\anaconda3\lib\site-packages\sklearn\__init__.py in <module>
     80     from . import _distributor_init  # noqa: F401
     81     from . import __check_build  # noqa: F401
---> 82     from .base import clone
     83     from .utils._show_versions import show_versions
     84 

D:\anaconda3\lib\site-packages\sklearn\base.py in <module>
     15 from . import __version__
     16 from ._config import get_config
---> 17 from .utils import _IS_32BIT
     18 from .utils._tags import (
     19     _DEFAULT_TAGS,

D:\anaconda3\lib\site-packages\sklearn\utils\__init__.py in <module>
     18 import warnings
     19 import numpy as np
---> 20 from scipy.sparse import issparse
     21 
     22 from .murmurhash import murmurhash3_32

D:\anaconda3\lib\site-packages\scipy\__init__.py in <module>
    128 
    129     # Allow distributors to run custom init code
--> 130     from . import _distributor_init
    131 
    132     from scipy._lib import _pep440

D:\anaconda3\lib\site-packages\scipy\_distributor_init.py in <module>
     57             os.chdir(libs_path)
     58             for filename in glob.glob(os.path.join(libs_path, '*dll')):
---> 59                 WinDLL(os.path.abspath(filename))
     60         finally:
     61             os.chdir(owd)

D:\anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    371 
    372         if handle is None:
--> 373             self._handle = _dlopen(self._name, mode)
    374         else:
    375             self._handle = handle

FileNotFoundError: Could not find module 'D:\anaconda3\lib\site-packages\scipy\.libs\libbanded5x.EHDKC2XVYTQQ5MALRS6XN2CUSS6SRL6P.gfortran-win_amd64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

我也遇到了同样的问题。在我的例子中,它在降级到tornado=6.0.4、scikit learn=0.23.2和scypi=1.5.2后解决了。

欢迎来到StackOverflow Lee!第一个错误之一是:“
assert sklearn.\uuuuu version\uuuuu>=”0.20“
”。您的软件包中是否存在冲突?您可以尝试升级:
!pip安装—升级scikit学习
I已升级,但仍然与错误消息相同。当从scipy.io import loadmat加载
时,我遇到了一个非常类似的错误,有什么线索吗?
{
  "kernelspecs": {
    "anaconda-base": {
      "resource_dir": "C:\\Users\\Wei-shan\\AppData\\Roaming\\jupyter\\kernels\\anaconda-base",
      "spec": {
        "argv": [
          "D:\\anaconda3\\python.exe",
          "-m",
          "ipykernel_launcher",
          "-f",
          "{connection_file}"
        ],
        "env": {},
        "display_name": "Anaconda (base)",
        "language": "python",
        "interrupt_mode": "signal",
        "metadata": {}
      }
    },
    "python3": {
      "resource_dir": "C:\\Users\\Wei-shan\\AppData\\Roaming\\jupyter\\kernels\\python3",
      "spec": {
        "argv": [
          "D:\\anaconda3\\python.exe",
          "-m",
          "ipykernel_launcher",
          "-f",
          "{connection_file}"
        ],
        "env": {},
        "display_name": "Python 3",
        "language": "python",
        "interrupt_mode": "signal",
        "metadata": {}
      }
    },
    "vpython": {
      "resource_dir": "C:\\Users\\Wei-shan\\AppData\\Roaming\\jupyter\\kernels\\vpython",
      "spec": {
        "argv": [
          "D:/Anaconda3/python.exe",
          "-m",
          "ipykernel_launcher",
          "-f",
          "{connection_file}"
        ],
        "env": {},
        "display_name": "Python 3",
        "language": "python",
        "interrupt_mode": "signal",
        "metadata": {}
      }
    }
  }
}