[英]OSError: [WinError 126] The specified module could not be found in Python
I am trying to import the following libraries.我正在尝试导入以下库。 I get an error message while importing sklearn.
导入 sklearn 时收到错误消息。 I believe it is related to DLL path but i am not able to rectify it.
我相信它与 DLL 路径有关,但我无法纠正它。 I don't want to manually specify any path in the code.
我不想在代码中手动指定任何路径。 Please help
请帮忙
Code:代码:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import preprocessing
%matplotlib inline
Error:错误:
OSError Traceback (most recent call last)
<ipython-input-3-c2a7628c052c> in <module>
3 import matplotlib.pyplot as plt
4
----> 5 from sklearn import preprocessing
6 get_ipython().run_line_magic('matplotlib', 'inline')
~\anaconda3\lib\site-packages\sklearn\__init__.py in <module>
62 else:
63 from . import __check_build
---> 64 from .base import clone
65 from .utils._show_versions import show_versions
66
~\anaconda3\lib\site-packages\sklearn\base.py in <module>
10
11 import numpy as np
---> 12 from scipy import sparse
13 from .externals import six
14 from .utils.fixes import signature
~\anaconda3\lib\site-packages\scipy\__init__.py in <module>
102
103 # Allow distributors to run custom init code
--> 104 from . import _distributor_init
105
106 __all__ += _num.__all__
~\anaconda3\lib\site-packages\scipy\_distributor_init.py in <module>
59 os.chdir(libs_path)
60 for filename in glob.glob(os.path.join(libs_path, '*dll')):
---> 61 WinDLL(os.path.abspath(filename))
62 finally:
63 os.chdir(owd)
~\anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
362
363 if handle is None:
--> 364 self._handle = _dlopen(self._name, mode)
365 else:
366 self._handle = handle
OSError: [WinError 126] The specified module could not be found
You can try uninstalling scipy and then re-installing this particular verison.您可以尝试卸载 scipy,然后重新安装此特定版本。 As it is stated in this particular github issue thread that there is a problem with the new release of scipy.
正如这个特定的 github 问题线程中所述,新版本的 scipy 存在问题。
pip uninstall scipy
pip install scipy==1.4.1
https://github.com/ultralytics/yolov5/issues/241 https://github.com/ultralytics/yolov5/issues/241
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.