Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to use conda activate <env> in my vscode's terminal. But nothing seems to work.

enter image description here

I have two environments, SharkiPyTorch and base, only the first one has Opencv installed. Despite of that I didn't get any response from using conda activate base. I tried to execute my example.py file, using both environments but I just got an error saying that the module OpenCV is missing.

I used the conda list for both environments and I checked that I have Opencv in one of them.

I don't know why I can't select my environments.

enter image description here

VScode is using Python's conda path.

I just noticed that doing code . in conda's terminal in the folder path, I can load my proyect from my environment and it works, nevertheless I'd like to be able to use commands for my environments from my Vscode's terminal.

question from:https://stackoverflow.com/questions/65651136/conda-how-can-i-activate-an-specefic-env

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
263 views
Welcome To Ask or Share your Answers For Others

1 Answer

The VSCode terminal "powershell" does not automatically activate the conda environment by default. I use the command "conda init powershell" to make it automatically activate the conda environment: (please open a new terminal)

enter image description here

Then, we can use the command "conda activate XXX" to activate other conda environments:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...