skip to Main Content

I need to change envs to other because envs is env folder.

conda activate /Users/x/miniconda3/envs
(base) ➜  cs git:(main) ✗ conda activate /Users/x/miniconda3/envs

EnvironmentLocationNotFound: Not a conda environment: /Users/x/miniconda3/envs

When i clickenter image description here, the path is correctly set.

Is there anything I can set in VScode to do such thing? I need this setting globally.

Now I can set task.json in workspace to do so, but still not global.

setting.json
"python.defaultInterpreterPath": "/Users/x/miniconda3/bin/python",
"python.condaPath": "/Users/x/miniconda3",

My expected outcome:

# new terminal open
conda activate <my_env_name_according_to_interpret_i_choose>

2

Answers


  1. Chosen as BEST ANSWER

    I installed a plugin https://marketplace.visualstudio.com/items?itemName=donjayamanne.python-environment-manager

    then I can set correct env now.

    I don't know if there exist someway I can set auto activate without a plugin?


  2. Sicne you want to activate conda on startup for every workspace:

    1. ctrl+shift+p

    2. Preferences : Open Default Settings (JSON)

    3. Add your conda path to:

      "terminal.integrated.env.<your OS>": {
         "PATH": "/Users/<username>/miniconda3/<env>"
      }
      
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search