Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

conda activate fails (results in IndexError: list index out of range)

I have a fresh copy of Ubuntu 22.04 that I'm running in a Hyper-V virtual machine in Windows 11 Pro. I just installed Anaconda from anaconda.com. Everything seems fine (I've also added Conda to the path.)

I created a new environment using:

conda create --name proto202211

Environment is created successfully and conda tells me:

to activate this environment, use $ conda activate proto202211

So I do that, but I get a long ERROR REPORT and the environment fails to activate. I rebooted the Linux machine. Same thing. I created a new environment, myenv, and I can't switch to that either (same error). I can list the environments, and conda sees proto202211 and myenv. It recognizes that they're there. But if I try to activate them, I get this long failure.

I've attached images of the errors that I'm getting.

First part of the error message

Second part of the error message

Help.

like image 794
Nathaniel Givens Avatar asked Dec 07 '25 04:12

Nathaniel Givens


1 Answers

I found the solution to this problem. After installing anaconda I manually edited my PATH using:

echo "export PATH=$PATH:/home/nate/anaconda3/bin">> ~/.bashrc

This was a bad idea. I removed that line from .bashrc using gedit, restarted bash, and now I can switch environments.

I got the idea to try this from this similar (but non-identical) question: unable to activate existing conda environments

like image 164
Nathaniel Givens Avatar answered Dec 08 '25 18:12

Nathaniel Givens



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!