导入 _ssl 错误,DLL 加载失败,Python 37 Anaconda Windows 10

ros*_*ose 5 python dll anaconda

我在 Win10 上遇到 _ssl 问题。我已将 python 包和代码从 Windows 7 移至 Windows 10。一开始我面临以下问题:

导入错误:缺少必需的依赖项 ['numpy']

但是这个问题通过重新安装 numpy 和 pandas 的 .whl 包得到了解决。

目前我在执行代码时面临以下问题:

import _ssl             # if we can't import it, let the error propagate
    ImportError: DLL load failed: The specified procedure could not be found. 
Run Code Online (Sandbox Code Playgroud)

参考关于堆栈溢出的其他问题并尝试了几个步骤:

  1. 按照此Python 3.7 anaconda 环境中的建议更改路径变量- 导入 _ssl DLL 加载失败错误

  2. 安装 pyopenssl 。

  3. 更新了系统环境变量。

  4. 重新启动了pycharm。

目前在 Anaconda 提示符下显示为:

   (base) C:\>
   (base) C:\>python
    Python 3.7.0 (default, Aug 14 2018, 19:12:50) [MSC v.1900 32 bit 
    (Intel)] :: Ana
     conda, Inc. on win32
     Type "help", "copyright", "credits" or "license" for more 
     information.
   >>> import ssl
  >>> import _ssl
  >>>
Run Code Online (Sandbox Code Playgroud)

这意味着 _ssl.pyd 文件没有问题。

这在 Windows 7 上工作得很好,但在 Windows 10 上却没有。

ros*_*ose 0

根据 Pycharm 论坛帖子,这是一个已知问题,将在下一个版本的 Pycharm 2019.1 中修复。解决此问题的唯一方法是使用 python 3.6 创建环境。如果您使用该环境作为解释器,PyCharm 应该可以正常工作。

干杯!!