1

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:

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Salvatore
  • 10,815
  • 4
  • 31
  • 69
  • I guess you should use 'anaconda prompt' instead of 'cmd'. It is basically cmd + conda activation which is adding all the necessary paths into 'path' variables. I have zero anaconda records in windows environment variables however I don't have problems with anaconda prompt, spyder and pycharm. –  Feb 09 '21 at 14:52
  • Related: *[Python is in a Conda environment, but it has not been activated in a Windows virtual environment](https://stackoverflow.com/questions/56679132/)* – Peter Mortensen Oct 26 '21 at 19:59
  • "I quite often use virtual environments, but never with Conda." *then why are you using a conda interpreter?* That doesn't make a lot of sense. – juanpa.arrivillaga Nov 20 '22 at 03:27
  • @juanpa.arrivillaga That really doesn't help clarify or solve the problem at all. Do you have a constructive suggestion/solution? – Salvatore Nov 21 '22 at 18:53

2 Answers2

2

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.

0

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.

XYZ
  • 352
  • 5
  • 19