Connection to Python debugger failed Socket operation on nonsocket: configureBlocking

程序可以运行不能调试

Debugger忽然不能用了,找了很多种方法,终于能解决了,提供参考。

 

"G:\Program Files (x86)\Python\python3.10.4\python.exe" "G:\Program Files\pycharm\PyCharm 2022.1\plugins\python\helpers\pydev\pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 62764 --file "G:/Program Files/pycharm/PycharmProjects/untitled/qingganfenlei.py"

Traceback (most recent call last):

  File "G:\Program Files\pycharm\PyCharm 2022.1\plugins\python\helpers\pydev\_pydev_bundle\pydev_imports.py", line 37, in <module>

    execfile=execfile #Not in Py3k

NameError: name 'execfile' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "G:\Program Files\pycharm\PyCharm 2022.1\plugins\python\helpers\pydev\pydevd.py", line 33, in <module>

    from _pydev_bundle import pydev_imports, pydev_log

  File "G:\Program Files\pycharm\PyCharm 2022.1\plugins\python\helpers\pydev\_pydev_bundle\pydev_imports.py", line 39, in <module>

    from _pydev_imps._pydev_execfile import execfile

  File "G:\Program Files\pycharm\PyCharm 2022.1\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18

    4    exec(compile(contents+"\n", file, 'exec'), glob, loc)

         ^^^^

SyntaxError: invalid syntax

Process finished with exit code 1

试了以下几种方法

1.

file → setting → Build, Execution, Deployment → Python Debugger,取消打钩“PyQt compatible”。点击应用,ok。

未成功

2.

查看报的错里面有module “queue”,然后一看当前项目的文件夹里面是否有python文件名和系统自带的文件重名的问题,删除或者重命名即可。

未成功

3.

关闭电脑Windows安全中心中的病毒查杀

未成功

4.

以上方法均没有解决,后来试试看改报错的三个PyCharm 2022.1\plugins\python\helpers\pydev里的文件,发现有一个模型其妙的4,删除后,竟然可以Debugger了。

2022.1\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18

    4    exec(compile(contents+"\n", file, 'exec'), glob, loc)

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐