Salvatore
Salvatore

Reputation: 11924

Python Anaconda interpreter is in a Conda environment, but the environment has not been activated

I have been using a working Anaconda install (Python 3.7) for about a year, but suddenly I'm getting this warning when I run the interpreter:

> python
Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 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 quite often use virtual environments, but never with Conda. Note that I've been able to run Python from the command line with just python for a long time now, and have never had to use conda activate base. I don't even have Conda on my path.

I've found these answers, but neither gives any clarity into why this may have started happening:

Upvotes: 1

Views: 5854

Answers (2)

Prajjwal Pandey
Prajjwal Pandey

Reputation: 21

If you receive this warning, you need to activate your environment. To do so on Windows, use the Anaconda Prompt shortcut in your Windows start menu. If you have an existing cmd.exe session that you’d like to activate conda in run:

call <your anaconda/miniconda install location>\Scripts\activate base.

Upvotes: 2

XYZ
XYZ

Reputation: 382

I have the same problem, by following this post conda-is-not-recognized-as-internal-or-external-command, I am able to solve the problem.

The reason may be that your default Python interpreter has been switch to the the Conda python (e.g. on my Wondows 10, the path is C:\Users\Xiang\anaconda3\python.exe). Therefore, we need to add the Conda related path to the Environments Path, with details explained in the link.

Upvotes: 1

Related Questions