英文:
Cannot debug test case in VS Code: Found duplicate in "env": PATH
问题
I am using VS Code for developing in Python. I have been able to debug single test cases from the test module, which is very practical. Since recently, it no longer works. After a short waiting time, a dialog pops up: "Invalid message: Found duplicate in "env": PATH." with the buttons "Open launch.json" and "Cancel". Opening launch.json does not help, since I don't manipulate PATH there. I also did not edit PATH recently (and the message seems to point not to a wrong value in PATH, but to PATH being set multiple times).
I tried to see the duplicate PATH myself, but failed: Both echo ${env:PATH}
at the console and os.environ
in Python will only give a single PATH variable - as already implied by the used data structure.
I tried applying this SO answer. It does neither relate directly to VS Code, nor to duplicate PATH variables, but to duplicates in PATH, but it was the closest I found on here. It didn't work.
英文:
I am using VS Code for developing in Python. I have been able to debug single test cases from the test module, which is very practical. Since recently, it no longer works. After a short waiting time, a dialog pops up: "Invalid message: Found duplicate in "env": PATH." with the buttons "Open launch.json" and "Cancel". Opening launch.json does not help, since I don't manipulate PATH there. I also did not edit PATH recently (and the message seems to point not to a wrong value in PATH, but to PATH being set multiple times).
I tried to see the duplicate PATH myself, but failed: Both echo ${env:PATH}
at the console and os.environ
in Python will only give a single PATH variable - as already implied by the used data structure.
I tried applying this SO answer. It does neither relate directly to VS Code, nor to duplicate PATH variables, but to duplicates in PATH, but it was the closest I found on here. It didn't work.
答案1
得分: 0
你可以安装不同版本的Python插件(对于可能关心的人:如果这不令人满意,可能是因为您运行了多个VS Code实例)。 请注意:
- 2023.4.1是已知的最新稳定版本,可正常工作。
- 2023.6.0不可用。
- v2023.7.11011538(最新)可正常工作。
看起来这是在VS Code团队最新稳定版本中解决的问题。
英文:
You can install different versions of the Python plugin (to whom it may concern: if this works unsatisfactorily, it may be because you have multiple instances of VS Code running). You will note:
- 2023.4.1 is the latest known stable version that works
- 2023.6.0 does not work
- v2023.7.11011538 (latest) works
It seems it's an issue in the latest stable version the VS Code team have solved in the meanwhile.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论