79306711

Date: 2024-12-25 01:36:08
Score: 2
Natty:
Report link

Answering this late because there is a workaround possible if you want to use Visual Studio debugging tools with Python and WSL2.

You cannot natively run WSL2 Python projects in Visual Studio, but you can run your Python code in WSL2 with debugpy, attach it as a "remote" process in the "debug->Attach to Process" section, and then debug in Visual Studio. Make sure you have identical copies of your files and folder structure in WSL2 and your Visual Studio Python project. See this guide for more details:

https://learn.microsoft.com/en-us/visualstudio/python/debugging-python-code-on-remote-linux-machines?view=vs-2022

Reasons:
  • Blacklisted phrase (1): this guide
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Taylor de Vos