[英]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:我已经使用 Anaconda 安装(Python 3.7)大约一年了,但是当我运行解释器时突然收到这个警告:
> 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
.我经常使用虚拟环境,但从不使用
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
.请注意,我已经能够从命令行运行
python
很长一段时间了,现在只使用 python ,并且从来没有使用过conda activate base
。 I don't even have conda
on my path.我的道路上什至没有
conda
。
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 cmd 警告:python 解释器处于 conda 环境,但该环境尚未激活
Python is in conda env, but has not been activated in Windows virtual env Python 在 conda 环境中,但尚未在 Windows 虚拟环境中激活
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.我有同样的问题,通过遵循这个帖子conda-is-not-recognized-as-internal-or-external-command ,我能够解决问题。
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
).原因可能是您默认的 Python 解释器已切换到 Conda python (例如在我的 Wondows 10 上,路径是
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.因此,我们需要将 Conda 相关路径添加到 Environments Path 中,详细信息在链接中进行了说明。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.