无法在VS Code中调试测试案例:在”env”中发现重复项:”PATH”

huangapple go评论75阅读模式
英文:

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实例)。 请注意:

  1. 2023.4.1是已知的最新稳定版本,可正常工作。
  2. 2023.6.0不可用。
  3. 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:

  1. 2023.4.1 is the latest known stable version that works
  2. 2023.6.0 does not work
  3. 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.

huangapple
  • 本文由 发表于 2023年4月17日 22:09:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76036074.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定