我最近买了一台新笔记本电脑,在上面安装了最新版本的 anaconda for python 3.7 和 pycharm 社区版。
我创建了一个虚拟环境,启动了 pycharm 并尝试运行一些代码,然后在控制台中收到一个错误
然后我重新安装了 anaconda,并没有创建 venv,而是尝试再次执行代码,并收到以下错误
C:\Users\chris.halliwell\AppData\Local\Continuum\anaconda3\python.exe "C:\Users\chris.halliwell\AppData\Local\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\pydevconsole.py" --mode=client --port=61636
Traceback (most recent call last):
File "C:\Users\chris.halliwell\AppData\Local\JetBrains\PyCharm Community Edition 2019.1.2\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:\Users\chris.halliwell\AppData\Local\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\_pydev_comm\rpc.py", line 4, in <module>
from _pydev_comm.server import TSingleThreadedServer
File "C:\Users\chris.halliwell\AppData\Local\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\_pydev_comm\server.py", line 4, in <module>
from _shaded_thriftpy.server import TServer
File "C:\Users\chris.halliwell\AppData\Local\JetBrains\PyCharm Community Edition 2019.1.2\helpers\third_party\thriftpy\_shaded_thriftpy\server.py", line 9, in <module>
from _shaded_thriftpy.transport import (
File "C:\Users\chris.halliwell\AppData\Local\JetBrains\PyCharm Community Edition 2019.1.2\helpers\third_party\thriftpy\_shaded_thriftpy\transport\__init__.py", line 57, in <module>
from .sslsocket import TSSLSocket, TSSLServerSocket # noqa
File "C:\Users\chris.halliwell\AppData\Local\JetBrains\PyCharm Community Edition 2019.1.2\helpers\third_party\thriftpy\_shaded_thriftpy\transport\sslsocket.py", line 7, in <module>
import ssl
File "C:\Users\chris.halliwell\AppData\Local\Continuum\anaconda3\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
这几乎与我之前收到的错误相同(除了位置不是 venv)
我缺少什么 DLL?我是否错误地设置了某个程序?
答案1
我遇到了同样的错误。我解决这个问题的方法是加载 anaconda 提示符,然后从提示符中运行 pycharm。这样就可以加载所有正确的依赖项。