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

Viewed 14815

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?

5 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.

Try installing the "Code Runner" extension, with that you should be able to run your programmes inside VSCode.

You haven't put any extension to your file. Think it should be *.py :)

I faced a similar kind of issue and what I did was "uninstall python" and then install it again. it worked perfectly in my case. I guess all MS products are plagued with these restarting/re-installing issues.

Marketplace python extension for VSCode by Microsoft

Related