Can't run python code through VS Code. Can't open file ptvsd_launcher.py [Errno 22] Invalid Argument

半城伤御伤魂 提交于 2020-06-27 16:30:47

问题


VSCode was working perfectly a few days ago before this started happening. Attempting to run any python code through VSCode (with or without debugging) Results in this error in the terminal

can't open file '"c:/Users/Rastus22/.vscode/extensions/ms-python.python-2019.5.17517/pythonFiles/ptvsd_launcher.py"': [Errno 22] Invalid argument

A little after the error shows I get a message telling me there was a timeout waiting for the debugger. There aren't any errors in the python itself, currently testing with a file that contains only a print statement. My only other extension is the Darkula theme.

I've tried reinstalling the Python extension and resetting the launch.json file as well as my settings.json file. I've also tried copying over a known good copy of launch and settings file from a different machine and had no luck. I can't really seem to find anyone else online with the same issue either.


回答1:


Downgrading to the 2019.4 fixed the issue completely. Thanks to Samuel Cooper for this answer.

Steps to downgrade:

  1. Make sure the Python extension is installed.

  2. Hit the "manage" button on the extension.

  3. "Install another version"

  4. Search for the version you want to move to. I downgraded to version 2019.4.12954



来源:https://stackoverflow.com/questions/56414957/cant-run-python-code-through-vs-code-cant-open-file-ptvsd-launcher-py-errno

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!