BudW
BudW

Reputation: 43

VScode keeps asking me to install conda to create conda environments, but it's already installed

OK, my larger problem is I did something to torch my Anaconda environments on my computer. I tried to remove some libraries that weren't working in an environment and wound up messing up all my environments. I uninstalled Anaconda and reinstalled it which brings us to my current problem.

IN VScode, when I try to create a conda python environment I get the message "please install 'conda' to create conda environments" even though Anaconda is installed. Also, Anaconda is acting weird in terminal. If I create a new environment I can run it in terminal, but when I try to run my old environments it says they don't exist, even though "conda info --envs" shows they are in the same folder as the new environments that do run. What's really weird is that VScode will acknowledge the old environments when I look to run python kernels, but not the new ones even though they are in the same folder.

I'm really at a loss for what to do about this and all my google searches are just turning up things like "How to install anaconda on a mac".

I tried installing Anaconda and then clicking create conda environment, but VScode returned a message saying please install conda.

Upvotes: 2

Views: 1954

Answers (1)

Kyle Brooks
Kyle Brooks

Reputation: 21

figured I would help you solve this even though it is a bit old.

I had the same issue, and reinstalling Anaconda helped but there were two steps on Fedora Linux 39:

  1. You said you already reinstalled conda. This is good, but if the next steps do not work you might do it again.

  2. Find your conda executable. For me, it was in "/home/<your_username>/anaconda3/bin". The executable is just called "conda" with no extension.

  3. In VSCode, go to Extensions>Python, and then click the little settings wheel. Go to "extension settings"

  4. In the search bar, DO NOT erase what is already there, but put a space and simply type "conda". You should see "Python:Conda Path". My bet is that this space is empty.

  5. Copy the path to your conda executable you found in step 2 and paste it here.

  6. Restart VSCode and try to create an environment.

Hope this helps. Again this was in Fedora Linux so finding your executable might be a different process, but the VSCode steps should largely coincide.

Cheers

Upvotes: 2

Related Questions