欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

pycharm有关scipy,sklearn报错:ImportError: DLL load failed: 找不到指定的程序。

程序员文章站 2022-04-16 15:58:58
前言报错正文报错信息"D:\Program Files\anaconda3\envs\TF2.1\python.exe" D:/deeplearning-tf2-master/models/mlp_mnist.pyTraceback (most recent call last): File "D:/deeplearning-tf2-master/models/mlp_mnist.py", line 6, in from sklearn.utils imp...

前言

报错

正文

报错信息

"D:\Program Files\anaconda3\envs\TF2.1\python.exe" D:/deeplearning-tf2-master/models/mlp_mnist.py
Traceback (most recent call last):
  File "D:/deeplearning-tf2-master/models/mlp_mnist.py", line 6, in <module>
    from sklearn.utils import shuffle
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\sklearn\__init__.py", line 80, in <module>
    from .base import clone
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\sklearn\base.py", line 21, in <module>
    from .utils import _IS_32BIT
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\sklearn\utils\__init__.py", line 23, in <module>
    from .class_weight import compute_class_weight, compute_sample_weight
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\sklearn\utils\class_weight.py", line 7, in <module>
    from .validation import _deprecate_positional_args
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\sklearn\utils\validation.py", line 26, in <module>
    from .fixes import _object_dtype_isnan
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\sklearn\utils\fixes.py", line 18, in <module>
    import scipy.stats
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\stats\__init__.py", line 388, in <module>
    from .stats import *
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\stats\stats.py", line 180, in <module>
    from . import distributions
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\stats\distributions.py", line 8, in <module>
    from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous,
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\stats\_distn_infrastructure.py", line 23, in <module>
    from scipy import optimize
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\optimize\__init__.py", line 387, in <module>
    from .optimize import *
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\optimize\optimize.py", line 36, in <module>
    from ._numdiff import approx_derivative
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\optimize\_numdiff.py", line 6, in <module>
    from scipy.sparse.linalg import LinearOperator
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\sparse\linalg\__init__.py", line 114, in <module>
    from .eigen import *
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\sparse\linalg\eigen\__init__.py", line 9, in <module>
    from .arpack import *
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\sparse\linalg\eigen\arpack\__init__.py", line 20, in <module>
    from .arpack import *
  File "D:\Program Files\anaconda3\envs\TF2.1\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 43, in <module>
    from . import _arpack
ImportError: DLL load failed: 找不到指定的程序。

Process finished with exit code 1

解决

错误问题应该是版本不兼容
1.卸载

pip uninstall scikit-learn
pip uninstall scipy

2.重装


pip  install --index https://pypi.mirrors.ustc.edu.cn/simple/ scipy
pip  install --index https://pypi.mirrors.ustc.edu.cn/simple/ scikit-learn

还是不行的话尝试numpy,scipy,scikit-learn全部卸载,再重新装上去

本文地址:https://blog.csdn.net/qq_45109870/article/details/107445268

相关标签: 小实习