使用PyCharm编写Python代码,Python输出窗口报错解决方案 Python 3.7 anaconda environment - import _ssl DLL load fail err
使用PyCharm编写Python代码,Python输出窗口报错解决方案 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
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
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
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
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
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
import ssl
File “C:\Users\abhil\AppData\Local\Continuum\anaconda3\envs\HeisenbergPy37\lib\ssl.py”, line 98, in
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
解决方案
his can be fixed by manually adding in the PATH variables in PyCharm to the console.
- Open your Anaconda cmd(Anaconda Prompt)
- Activate your CondaActivate your Conda environment
- 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
- In PyCharm, go to Settings -> Build, Execution, Deployment -> Console -> Python Console -> click the folder on the right of Environment variables.
- 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. - Click OK, then apply.
本文只是对现有知识的整理供大家解决问题!
原文:
https://stackoverflow.com/questions/54175042/python-3-7-anaconda-environment-import-ssl-dll-load-fail-error
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库