question

JamesShaw-6590 avatar image
0 Votes"
JamesShaw-6590 asked TianyuSun-MSFT commented

Can't run program because it asks me to attach on process

Hi guys,
I am using VS 2019
i have dragged an dropped a ".py" file into the VS 2019 icon and which has opened up a VS 2019 with the code however the green arrow to debug the code says "attach..."
I want to run a debugger, which is normally there instead of the "attach..." button.

how can i run a debugger?

vs-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @JamesShaw-6590 , I have not heard from you for a couple of days. Please let me know if there is anything that I can help here.

0 Votes 0 ·

1 Answer

TianyuSun-MSFT avatar image
0 Votes"
TianyuSun-MSFT answered

Hello @JamesShaw-6590 ,

Welcome to Microsoft Q&A forum.

You need to create a new Python related project(or open a Python project) in Visual Studio to debug your project which includes the .py file and python codes. Just open a single .py file is not enough to debug the project in Visual Studio, so you will see the “Start” changed to “Attach…”.

112769-image.png

112784-image.png

Suggestion:

Please try to create a Python project and then copy and paste the Python code from the single .py file to the project’s .py file and then debug the whole project.

BTW, for more information about Attach to process feature, you can refer to this document: Attach to running processes with the Visual Studio debugger.

Best Regards,
Tianyu


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (67.0 KiB)
image.png (37.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.