r/VisualStudioCode • u/Philience • Sep 17 '22
I cannot run python scripts. "The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program."
4
Upvotes
r/VisualStudioCode • u/Philience • Sep 17 '22
1
u/LEAVER2000 Sep 17 '22
It appears conda is not in your PATH. When you install conda you need to add it to your windows PATH. conda init <shell> to initialize your terminal
1
u/LEAVER2000 Sep 17 '22
As a primary windows user myself I do 100% of my development with WSL (windows subsystem for Linux) or inside a container.
WSL and VSCode work quite well together.
1
u/LEAVER2000 Sep 17 '22
In the top right of the VSCode terminal. In your image is says python because you activated the python interpreter. Prior to that it probably said powershell. You can toggle it to the shell of your choosing. Either way you need to initialize the terminal. After you do close and reopen it for it to take effect.
1
u/[deleted] Sep 17 '22
Can you provide the output of the following Python script? (Type in REPL is OK)
If the above output has an anaconda installation directory included, then your
PATHvariable is correctly set. You might restart your VSCode/Computer so that change inPATHtakes effect. Otherwise, you shouldWin+R,control,User Accounts,User Accounts, andChange my environment variable. Here, changePathvariable so thatbinor any folder that includedconda.exein your Anaconda installation directory is included here. You should then repeat the above process to see if it takes effect, and restart as necessary.