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

James Shaw 1 Reputation point

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?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,593 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 27,181 Reputation points Microsoft Vendor

    Hello @James Shaw ,

    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…”.




    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,

    • 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.
    0 comments No comments