Quantcast
Channel: User Sabito stands with Ukraine - Stack Overflow
Viewing all articles
Browse latest Browse all 45

Visual Studio Code terminal doesn't activate Conda environment

$
0
0

I read this Stack Overflow post on a similar issue, but the suggestions there don't seem to be working. I installed Visual Studio Code on my Windows machine and added the Python extension. Then I changed the Python path for my project to C:\Users\username\.conda\envs\tom\python.exe. The .vscode/settings.json has this in it:

{"python.pythonPath": "C:\\Users\\username\\.conda\\envs\\tom\\python.exe"}

The status bar in Visual Studio Code also shows:

Enter image description here

But when I do conda env list even after doing conda activate tom in the terminal I get the output:

# conda environments:#base                  *  C:\ProgramData\Anaconda3tom                      C:\Users\username\.conda\envs\tom

Instead of:

# conda environments:#base                     C:\ProgramData\Anaconda3tom                   *  C:\Users\username\.conda\envs\tom

Also the packages not installed in base don't get imported when I try python app.py. What should I do?

where python runs, but it doesn't give any output.

Also,

import osimport sysos.path.dirname(sys.executable)

gives

'C:\\Python38'

Viewing all articles
Browse latest Browse all 45

Latest Images

Trending Articles





Latest Images