Conda environment is not activated in current terminal
See original GitHub issueEnvironment data
- VS Code version: 1.43.2
- Extension version (available under the Extensions sidebar): 2020.3.69010
- OS and version: Win 10
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.8
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): Conda 4.8.3
Expected behaviour
Conda env should activate in current terminal on load of the extension
Actual behaviour
Conda env does not activate in current terminal on load of the extension, despite "python.terminal.activateEnvInCurrentTerminal": true
.
Possible explanation
This is the same as #10782. I thought I had fixed the problem but I was wrong. What I realized is that the extension does not trigger the .../miniconda/Scripts/activate
only for environments with very long names. Try for example to create a new Conda environment with
conda create -n this_is_a_very_long_environment_name python
Everything works fine if I use a shorter name.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
anaconda - Conda activate not working? - Stack Overflow
To do so, run $ conda activate in your terminal, or to put the base environment on PATH permanently, run $ echo "conda...
Read more >No indication of activated conda environment in terminal
Problem. I have a local conda environment in a folder, but when I activate it, I get no indication of having done so....
Read more >terminal not activating the conda environment : PY-23417
This will create the environment at /opt/anaconda3/envs/. After this, when starting a new project, select this environment from existing environments.
Read more >Managing environments - Conda
Determining your current environment ... If the environment is not activated, in your terminal window or an Anaconda Prompt, run: conda list -n...
Read more >Efficient Way to Activate Conda in VSCode - Medium
If you have problem finding the conda virtual environment path, you can open a terminal with your target conda env activated, and then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This particular issue with long
conda
env names is addressed, and the fix is in master. It will be available in the May release.Hi. I just figured out that I have this exact same issue. Here are some pointers that might help: Responsible code: https://github.com/microsoft/vscode-python/blob/61b179b2092050709e3c373a6738abad8ce581c4/src/client/interpreter/locators/services/condaHelper.ts#L59
If the name is too long, the split-offset is wrong and part of the name is added to the path:
which is expected if you have a look at the output of the “conda env list”-command where the / of the base-path aligns with the g that gets clipped from the path of the other environment:
hope this helps.