WSL 2:Pycharm调试器连接超时

m0r7y

我将Pycharm设置为在wls 2中使用virtualenv,
它工作正常,我的意思是,我可以通过“运行”按钮运行我的项目,
问题是我无法使用调试器,它说连接超时,让我向您展示完整的[错误] [1]。
('Connecting to ', '172.21.176.1', ':', '63597')
Could not connect to 172.21.176.1: 63597

看来,当我在调试模式下运行时,它想连接到172.21.176.1(wsl 2 ip地址),
但它应该连接到127.0.0.1,因为该进程是由ubuntu2004.exe启动的。
你能帮助我吗?
错误:

C:\ Users \ tux \ AppData \ Local \ Microsoft \ WindowsApps \ ubuntu2004.exe运行“ export IDE_PROJECT_ROOTS = / mnt / c / Users / tux / Documents / projects / odoo / 13 && export PYCHARM_DEBUG = True && export PYTHONUNBUFFERED = 1 &&导出IPYTHONENABLE = True &&导出PYCHARM_HOSTED = 1 &&导出PYTHONIOENCODING = UTF-8 &&导出PYCHARM_DISPLAY_PORT = 63342 &&导出PYTHONDONTWRITEBYTECODE = 1 &&导出PYDEVD_LOAD_VALUES_ASYNC = True &&导出“ LIBRARY_ROOTS /本地/应用程序/数据/应用/PyCharm2020.1/remote_sources/525578736/201545293:/mnt/c/Users/tux/AppData/Local/JetBrains/PyCharm2020.1/remote_sources/525578736/1688665391:/mnt/c/Users/tux/AppData/Local/JetBrains /PyCharm2020.1/python_stubs/525578736:/mnt/d/Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / python-skeletons:/ mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / typeshed / stdlib / 3.7:/ mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / typeshed / stdlib / 3:/ mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / typeshed / stdlib / 2and3:/ mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / typeshed / third_party / 3:/ mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / typeshed / third_party / 2and3“ &&导出“ PYTHONPATH = / mnt / c / Users / tux / Documents / projects / odoo / 13:/ mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pycharm_matplotlib_backend:/ mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pycharm_display:/ mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / third_party / thriftpy:/ mnt / d /程序文件/ JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pydev:/mnt/c/Users/tux/AppData/Local/JetBrains/PyCharm2020.1/cythonExtensions:/ mnt / c / Users / tux / Documents / projects / odoo / 13“ && cd / mnt / c / Users / tux / Documents / projects / odoo / 13 && /opt/interpreters/python3.8_odoo_13/bin/python3” / mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pydev / pydevd.py“ --multiproc --qt-support = auto --client 172.21.176.1 --port 63597 --file / mnt / c / Users / tux / Documents / projects / odoo / 13 / odoo-bin -c conf / learning.conf“执行PyCharm8_odoo_13 / bin / python3“ / mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pydev / pydevd.py” --multiproc --qt-support = auto --client 172.21.176.1- -port 63597 --file / mnt / c / Users / tux / Documents / projects / odoo / 13 / odoo-bin -c conf / learning.conf“执行PyCharm8_odoo_13 / bin / python3“ / mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pydev / pydevd.py” --multiproc --qt-support = auto --client 172.21.176.1- -port 63597 --file / mnt / c / Users / tux / Documents / projects / odoo / 13 / odoo-bin -c conf / learning.conf“执行PyCharmsitecustomize 追溯(最近一次通话):文件“ / mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pycharm_matplotlib_backend / sitecustomize.py”,第43行,在导入matplotlib ModuleNotFoundError中:没有名为“ matplotlib'无法加载jupyter_debug插件执行文件/ mnt / c / Users / tux / Documents / projects / odoo / 13 / odoo-bin自变量:['/ mnt / c / Users / tux / Documents / projects / odoo / 13 / odoo-bin','-c','conf / learning.conf'] PYDEVD_FILTER_LIBRARIES False

在多进程模式下启动

(“正在连接到”,“ 172.21.176.1”,“:”,“ 63597”)无法连接到172.21.176.1:63597回溯(最近一次调用是最近一次):文件“ / mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pydev / _pydevd_bundle / pydevd_comm.py“,第456行,位于start_client s.connect((host,port))socket.timeout中:超时Traceback(最近一次调用是最近一次):File” / mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pydev / pydevd.py”第2131行,位于main()文件“ / mnt / d / Program Files / JetBrains / PyCharm 2020.1”中。 2 / plugins / python / helpers / pydev / pydevd.py”,行2013,在主dispatcher.connect(主机,端口)中,文件“ / mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers” /pydev/pydevd.py”,行1788,在connect self.client = start_client(self.host,self。port)文件“ / mnt / d / Program Files / JetBrains / PyCharm 2020.1.2 / plugins / python / helpers / pydev / _pydevd_bundle / pydevd_comm.py”,行456,位于start_client s.connect((host,port))套接字中.timeout:超时

流程以退出代码1完成

PATAPOsha

防火墙就是这种情况。从Pycharm(在我的情况下为Eset防火墙)中取消连接的连接很有帮助。参见https://youtrack.jetbrains.com/issue/PY-39051

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档