I was using C++ in VS-Code for the past few months. A week back I installed python and used it in VS Code. Two days back I also installed Anaconda Navigator (Jupiter Notebook)
Now, I am unable to run C++ code in VS Code. On pressing the code run button in VS Code, the terminal shows the following output and then nothing happens:
cd "e:\Code\DSA\" ; if ($?) { g++ first.cpp -o first } ; if ($?) { .\first }
Can someone pls help me fix it. I tried to find a solution through Google, read few threads on Stackoverflow too but unable to understand what to do.
Uninstalling Anaconda Navigator fixed the issue.
Read Anaconda Navigator installation guide, found out that I messed up with environment variables.
Related
I have just begun to code so everything is new to me. I have started using VS Code with Python 3.11 and macOS Monterey 12.6. However, very soon I discovered that when I enter the "code" command at the terminal command line, it comes back "command not found."
I have to go the command palette, uninstall the code command and then reinstall it for it to work. The problem with this is that it resets everytime I close VS Code so I have to go back and repeat the whole process of unstalling and reinstalling the code command. I have read some other posts on stackoverflow that seem to address this issue but my knowledge of programming is extremely rudimentary and I was unable to understand the answers provided. Any help would be much appreciated. Thank you.
Maybe this will work:
open vscode
press CMD + SHIFT + P
type "shell command: install 'code' in PATH"
type 'code .' in your project folder
The code is not compiling on VSCode. I am using the MingW compiler for C++ and it's showing this:
Earlier, the terminal that I was using was powershell integrated into VSCode, which showed this error , but now the above is happening when I am using Git Bash terminal.
I have tried searching on internet but couldn't find anything helpful. What should I do from here?
Any help will be appreciated!
I am very new here, and also in programming.
I have found out that I have VS Code two times installed with different ways. When I started it from the KDE it ran well, but when I have started it from the current directory with "code ." it was an oss version without some extension and accounts.
Now I want to uninstall completely both of them. One version I could from terminal with yay --remove code. So the terminal can't see any versoion of vs code any more. But in the application launcher is vs code still there, I can run it and use completely. But I have no idea how to uninstall it.
I have already tried this: https://code.visualstudio.com/docs/setup/uninstall
you can uninstall from manjaro linux by visiting the add software>installed>code and clicking the trashcan near the name of the software. this will queue the action of deletion. Now just click apply on the bottom right of the screen and confirm all the things it will ask you. then it will uninstall code.
So I also had this problem, I found this command for uninstall vs code,
sudo pacman -R visual-studio-code-bin
I'm having an issue where if I do code <filename> where the file does not already exist, it does not create a new file.
Normally, vscode would (almost) create a new file, I could write some code, and then save it and it would appear in my file manager. But this just stopped working.
I had a look through all my extensions and uninstalled all the recent extensions. I've reinstalled vscode, still no luck.
I am using windows with wsl, this affects me when running vscode both in windows and in wsl.
Did some googling around, can't find anything useful. Any advice?
I figured out what caused this in case anyone else is having the same problem.
I installed Rust in windows and that seemed to have messed up the code command.
Sorry, can't remember which version it was, I just uninstalled it on windows and noticed that it fixed it.
(p.s: Rust is great, but I have it installed in WSL so don't need it in windows.)
If you are using npm on windows, you can install touch by running npm i -g touch and creating a folder in a specific location by navigating in the location and creating by mkdir <foldername> navigating inside it and using touch <filename>. From there you can simply launch VS Code by running code . in that folder namespace
If you are using WSL (Ubuntu), it comes preinstalled and you can run mkdir <foldername> && touch <filename> && code .
Not exactly what you are looking for but it can work!
I recently got a new computer and reinstalled visual studio code but I haven't been able to run any of my files. The error has occurred with both python and C++, so I feel as though it is the IDE that is the problem. I have looked online and there are no straight answers as I have tried following some solutions which have resulted in different errors.
The error above comes up when I run (F5) a simple line of code in c++. Does anyone have a solution?
Thanks, Jacob
[EDIT]
For my python files to work I have to manually select 'Python: current file' but for c++ files they still have the same error.
First step, uninstall python from this machine.
Second, reinstall and make sure that you check the box "add to path".
It's pretty easy to miss as it's a small box, and I missed it my first time installing python earlier in the year. Here's the box you may have missed while installing.
It could be your extensions.
I had a similar error message and simply updated all of my extensions and then my SDK. I was then able to run my code within the IDE. I was using VSCode for c++ and also updated my GCC compiler along with the extensions.
Also look into your computer's environment variables, if you have changed the %PATH variables it may be affecting your ability to run/compile programs.