[zz] Python 3.7 anaconda environment - import _ssl DLL load fail error

Posted xfzhang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[zz] Python 3.7 anaconda environment - import _ssl DLL load fail error相关的知识,希望对你有一定的参考价值。

https://stackoverflow.com/questions/54175042/python-3-7-anaconda-environment-import-ssl-dll-load-fail-error

 

 

C:\Users\abhil\AppData\Local\Continuum\anaconda3\envs\HeisenbergPy37\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.1\helpers\pydev\pydevconsole.py" --mode=client --port=63950
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.1\helpers\pydev\pydevconsole.py", line 5, in <module>
from _pydev_comm.rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.1\helpers\pydev\_pydev_comm\rpc.py", line 4, in <module>
from _pydev_comm.server import TSingleThreadedServer
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.1\helpers\pydev\_pydev_comm\server.py", line 4, in <module>
from _shaded_thriftpy.server import TServer
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.1\helpers\third_party\thriftpy\_shaded_thriftpy\server.py", line 9, in <module>
from _shaded_thriftpy.transport import (
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.1\helpers\third_party\thriftpy\_shaded_thriftpy\transport\__init__.py", line 57, in <module>
from .sslsocket import TSSLSocket, TSSLServerSocket # noqa
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.1\helpers\third_party\thriftpy\_shaded_thriftpy\transport\sslsocket.py", line 7, in <module>
import ssl
File "C:\Users\abhil\AppData\Local\Continuum\anaconda3\envs\HeisenbergPy37\lib\ssl.py", line 98, in <module>
import _ssl # if we can‘t import it, let the error propagate
ImportError: DLL load failed: The specified module could not be found.
Process finished with exit code 1

 

 

D:\Anaconda3\python.exe "D:\Program Files\JetBrains\PyCharm 2018.3.3\helpers\pydev\pydevconsole.py" --mode=client --port=55113
Traceback (most recent call last):
File "D:\Program Files\JetBrains\PyCharm 2018.3.3\helpers\pydev\pydevconsole.py", line 5, in <module>
from _pydev_comm.rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client
File "D:\Program Files\JetBrains\PyCharm 2018.3.3\helpers\pydev\_pydev_comm\rpc.py", line 4, in <module>
from _pydev_comm.server import TSingleThreadedServer
File "D:\Program Files\JetBrains\PyCharm 2018.3.3\helpers\pydev\_pydev_comm\server.py", line 4, in <module>
from _shaded_thriftpy.server import TServer
File "D:\Program Files\JetBrains\PyCharm 2018.3.3\helpers\third_party\thriftpy\_shaded_thriftpy\server.py", line 9, in <module>
from _shaded_thriftpy.transport import (
File "D:\Program Files\JetBrains\PyCharm 2018.3.3\helpers\third_party\thriftpy\_shaded_thriftpy\transport\__init__.py", line 57, in <module>
from .sslsocket import TSSLSocket, TSSLServerSocket # noqa
File "D:\Program Files\JetBrains\PyCharm 2018.3.3\helpers\third_party\thriftpy\_shaded_thriftpy\transport\sslsocket.py", line 7, in <module>
import ssl
File "D:\Anaconda3\lib\ssl.py", line 98, in <module>
import _ssl # if we can‘t import it, let the error propagate
ImportError: DLL load failed: 找不到指定的模块。
Process finished with exit code 1

 

This can be fixed by manually adding in the PATH variables in PyCharm to the console.

  1. Open your Anaconda cmd
  2. Activate your Conda environment
  3. Get the full PATH value by typing echo %PATH%
    • if you are on Windows 7/can‘t copy the output, cd the cmd to your desktop and type echo %PATH% > path_val.txt
    • this will create a txt file so you can copy/paste the values easier.
  4. In PyCharm, go to Settings -> Build, Execution, Deployment -> Console -> Python Console -> click the folder on the right of Environment variables.
  5. Click the plus button to add a new Environment Variable
    • The name should be PATH
    • The value is the entire output from the echo %PATH% command above.
  6. Click OK, then apply.

 

以上是关于[zz] Python 3.7 anaconda environment - import _ssl DLL load fail error的主要内容,如果未能解决你的问题,请参考以下文章

没有模块 QtMultimedia [Mac OS - Anaconda - Python 3.7 - PyQt5]

Anaconda 总是安装 Python 3.7

安装完Anaconda python 3.7,想使用python3.6方法

Anaconda 下 Python 3.7 和 3.8 的切换

Python 3.7 anaconda 环境 - import _ssl DLL 加载失败错误

吴恩达课程使用keras cpu版安装接- anaconda (python 3.7) win10安装 tensorflow 1.8 cpu版