Cannot activate environment in anaconda prompt

1.5k Views Asked by At

I input python in cmd and it shows a warning:

C:\Users\sky>python
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated.  Libraries may fail to load.  To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.
>>>

I cannot use pip install any packages, I thought maybe that's the problem. So I checked the information at the link:https://conda.io/activation and followed the instruction:

c:\Anaconda3\Scripts\activate base

It said 'system cannot find the path'. I searched for the files in that path and found two of them are named 'activate'. So I input

c:\Anaconda3\Scripts\activate

but still,'system cannot find the path'. How to activate the conda environment? I really need some help. Thanks

1

There are 1 best solutions below

0
Peter On

In a clean Anaconda installation you should have condabin only, e.g.

C:\Anaconda3\condabin

on your system path. To activate the base environment from the command prompt you use

C:\> conda activate

(base) C:\>

This will add the following folders to your system path too:

C:\Anaconda3;
C:\Anaconda3\Library\mingw-w64\bin;
C:\Anaconda3\Library\usr\bin;
C:\Anaconda3\Library\bin;
C:\Anaconda3\Scripts;

Only now you you are ready to run python and import all your packages properly.

The same thing typically happens when you select Anaconda prompt from your programs menu.