question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Miniconda3 environment created with `--prefix` flag fails to auto activate in terminal

See original GitHub issue

I have a Debian system with miniconda3 installed and two environments: a global one ('base': conda) and a local one ('.conda-env': conda). When selecting the global one and creating a new terminal window the environment is correctly activated via the following commands:

$ source /opt/miniconda3/bin/activate
(miniconda3) $ conda activate base
(miniconda3) $

Whereas if I select the local one, the activation does not take place:

$ source activate .conda-env
bash: activate: No such file or directory

In reality in both cases it would be enough if the automatic call was:

$ conda activate <environment>

instead of:

$ source <python.pythonPath>
$ conda activate <environment>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:27 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
simozaccacommented, Jan 28, 2021

With newer versions of conda, the activating command source activate ${env} is not by default added by conda initialization and vscode fails to activate any virtual environment with error activate does not exist. Is it possible to fix this to make it compatible with new conda and please use conda activate ${env} instead? Clearly https://github.com/microsoft/vscode-python/issues/8870 would be ideal

I added activate to my .bashrc but does anyone any other temporary workaround? I consider this to be a very disruptive issue that might be very easy to solve?

2reactions
itzsimplcommented, Dec 3, 2019

I tend to agree with @DonJayamanne, but I’d also upvote the idea mentioned by @karrtikr. From a user’s standpoint, it would be good to have the flexibility to change the activation script, if necessary. A working default should however always be provided.

Read more comments on GitHub >

github_iconTop Results From Across the Web

conda environment has no name visible in conda env list
One option to use conda activate B3 , is to recreate your B3 env in the default directory. You can use the --clone...
Read more >
Managing environments - Conda
Use the terminal or an Anaconda Prompt for the following steps: ... You then activate an environment created with a prefix using the...
Read more >
Working with Environments – Introduction to Conda for (Data ...
First, conda can no longer find your environment with the --name flag; you'll generally need to pass the --prefix flag along with the...
Read more >
Installing in silent mode - Anaconda Documentation
Silent mode installation can be useful when deploying Anaconda Distribution or Miniconda to many clients, as the installation can be completed automatically ......
Read more >
Micromamba - Mamba's documentation!
To activate an environment just call micromamba activate /path/to/env or, ... Done Transaction Prefix: /home/wolfv/miniconda3/envs/xtensor_env Updating ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found