0

As said in the title, my Python Debugger in visual studio seems to only be working on new scripts I create. I must have accidentally updated something or changed a setting earlier since I got the error mention in this link:

VSCode Python: Error while enumerating installed packages

I installed importlib-metadata and debugpy as mentioned in one of the comments of that thread and it seemed to remove the Error while enumerating installed Packages issue. However, the debugger simply does nothing now when I try to run it on one of my old scripts. I will click on run at the top application, click 'Start Debugging', and nothing happens.

When I do the same thing for any script I created after the Error while enumerating installed package error, the debugger seems to work just fine.

I would rather not have to recreate all my scripts just so I am able to debug them. Why would the debugger only work on scripts that were created after a certain error occurred?

Also it is worth noting both work just fine when running normally without the debugger.

testnewscript.py was created after I had weird enumeration error and fixed, testscript.py was created before. Only the new one works with the debugger now for some reason

Thanks

5
  • 1
    weird. I wonder if any relation to stackoverflow.com/q/77991608/11107541. any pycache directory? (if so, what if you delete it and try again?) Commented Feb 14, 2024 at 1:08
  • @starball do you know a good way to go about deleting everything? I tried uninstalling then reinstalling VS Code and also tried deleting all files located in C:\Users\myusername\.vscodes\extensions then redownloading all the extensions. But neither seemed to change anything. Do you know where a pycache directory would be? Commented Feb 14, 2024 at 4:20
  • 1
    there's also the user data directory. stackoverflow.com/q/70396384/11107541 careful with that though. back up your settings and things before nuking that. and may need to reinstall. I've never done it and can't promise things won't go wrong if you do. Commented Feb 14, 2024 at 4:25
  • @starball Thank you for the suggestion but not sure if I want to nuke my whole computer. One other thing that is weird is if I delete a script that was not working with the debugger and recreate it under the same file path with the same name, it still does not work. If it is in another file path or has a different name the debugger does work. Do you think it is storing the information of those file paths linking it with a faulty debugger? Commented Feb 14, 2024 at 18:51
  • deleting user data dir is not nuking the whole computer. you could just delete the workspace storage for your current workspace. maybe there's something in there that's latching this. under user data dir, User/workspaceStorage/. Commented Feb 14, 2024 at 19:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.