Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Run button in VS Code don't show up [Python]

I recently create an app using Python in VS Code. I made some modifications and now the Run button in the top left is gone. I can only run the app with the debug mode. I already try to click the little bug as it was suggested on another post. It is doing the same on my macbook when I share my code with Github. If I run the same code in a new file the Run button came back.

see the image as an exemple.

Do you have any way to solve this problem without having to create a new file?

like image 431
Louis-Philippe Tardif Avatar asked Jun 24 '20 16:06

Louis-Philippe Tardif


People also ask

Why is my run button not showing in VS Code?

"Tools > Debugger > Show run to click button in editor" option is turned on.

How do I enable the Run button in VS Code?

To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D.

Where is the Run button in Visual Studio?

Run the program To start building the program, press the green Start button on the Visual Studio toolbar, or press F5 or Ctrl+F5. Using the Start button or F5 runs the program under the debugger. Visual Studio attempts to build and run the code in your project.


1 Answers

You have two options here:

  • Install Microsoft Python extension for Visual Studio Code and Microsoft Jupyter extension for Visual Studio Code

Search for Python in Microsoft Visual Studio Code's Extension: Marketplace and hit on install.

enter image description here

Search for Jupyter in Microsoft Visual Studio Code's Extension: Marketplace and hit on install.

enter image description here

Or you can use your terminal or command prompt to install them. Open the terminal or command prompt and write these commands there.

Install Microsoft Python extension,

code --install-extension ms-python.python

Install Microsoft Jupyter extension ,

code --install-extension ms-toolsai.jupyter
  • Install Code Runner for Visual Studio Code

Search for Code Runner in Microsoft Visual Studio Code's Extension: Marketplace and hit on install.

enter image description here

Or you can use your terminal or command prompt to install it. Open the terminal and write the command.

Install Code Runner,

code --install-extension formulahendry.code-runner

You must go with the first option by Microsoft. If you go with both the options, you install Code Runner and Microsoft Python and Jupyter extensions then the Microsoft Python extension will only work if you disable Code Runner.

Code Runner is a good extension for C, C++, Java, Javascript, Perl, ... but for Python Microsoft Python and Jupyter extension is the best.

like image 165
Ayush Avatar answered Nov 04 '22 19:11

Ayush