skip to Main Content

My vscode can’t run any code.I’ve been trying to fix it for 2-3 days now but that doesn’t work.I don’t know it about I try to setup c/c++ in vscode about 15 days ago that time it work it can c c++ python however this few day I back to code something and have found can’t run any code.

can anyone please suggested solutions.I read previous post about this before but it not the same when I try to run code noting happening and no error.

and about python files must call file like this for run and that file must in Drive C.It unlike normal just press F5 or click runcode then it run.

I want to fix it like before.It mean make it to show the result of my code in visual studio.

2

Answers


  1. Trial 1: Try downgrading your vs-code version and check if problem still persists.
    Trial 2: Assuming you don’t have code runner, Try installing code runner extension in vs-code and use that for running your program

    Login or Signup to reply.
  2. If you can’t run any code inside VSCode it’s most likely the lack of needed extensions causing the problem, you can download extensions by going to the extension menu with ctrl + shift + x and if you are connected to the internet, VSCode will show recommended extensions for you.

    About the problem that you can’t run a python file outside of the C: drive, I think that the anonymity of your python executor to the CMD is causing this problem.

    The easiest way to fix it is to uninstall your python executable with its own installer (the setup.exe file which you installed python with, it can uninstall python too) and installing it again with the difference that you must tick the "add to environment variables" option at the beginning of the installation, then you may be able to run the python executable everywhere with this command:

    python example.py
    

    After installing c/c++ extension you might want to go to the extension you downloaded and look under the extension name for other c/c++ extensions you want to install too.

    To make intellisense and built-in c/c++ code execution work, download Microsoft’s c/c++ extension for the best experience.

    May this help you!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search