简体   繁体   中英

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:

cmd warning: python interpreter is in a conda environment, but the environment has not been activated

Python is in conda env, but has not been activated in Windows virtual env

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 (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM