python - sklearn 已安装但无法导入
问题描述
当我尝试导入 sklearn 时,出现以下错误。
请查找以下错误跟踪以获取更多详细信息:
C:\Users\Priyanshu\AppData\Local\Programs\Python\Python37-32\Lib\site-packages> pip install sklearn Requirement already satisfied: sklearn in c:\users\priyanshu\appdata\local\programs\python\python37-32\lib\site-packages (0.0)
Requirement already satisfied: scikit-learn in c:\users\priyanshu\appdata\local\programs\python\python37-32\lib\site-packages (from sklearn) (0.22)
Requirement already satisfied: numpy>=1.11.0 in c:\users\priyanshu\appdata\local\programs\python\python37-32\lib\site-packages (from scikit-learn->sklearn) (1.17.2)
Requirement already satisfied: joblib>=0.11 in c:\users\priyanshu\appdata\local\programs\python\python37-32\lib\site-packages (from scikit-learn->sklearn) (0.14.1)
Requirement already satisfied: scipy>=0.17.0 in c:\users\priyanshu\appdata\local\programs\python\python37-32\lib\site-packages (from scikit-learn->sklearn) (1.3.1)
PS C:\Users\Priyanshu\AppData\Local\Programs\Python\Python37-32\Lib\site-packages> python Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Priyanshu\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\sklearn\__init__.py", line 75, in <module>
from .utils._show_versions import show_versions
File "C:\Users\Priyanshu\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\sklearn\utils\_show_versions.py", line 12, in <module>
from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: DLL load failed: The specified module could not be found.
>>>
解决方案
The same error is fixed by installing sklearn below 0.22. Please try the below command.
pip install scikit-learn==0.21.3
推荐阅读
- c++ - 如何检索模板化对象实例化的类型?
- typescript - 无法访问变量
- c# - IdentityServer4:无法从以下位置获取配置:'https://myServer/.well-known/openid-configuration
- c++ - 如何测试 unicode 字符(char32_t)在 C++ 中是否为大写
- php - 从一个表中获取 id 并同时插入另一个表
- authentication - 如何通过负载均衡策略更好地利用本地缓存?
- sql - 带有 ASPEN Sqlplus 的 Matlab 数据浏览器应用程序
- javascript - Lodash uniqBy 更新最新值
- visual-studio - 安装程序检测到 vcredist_x64\vc_redist.x64.exe 自最初发布以来已被更改
- java - 为什么 println() 不打印两个参数?