在Windows10系统下,进入cmd,输入python,提示Anaconda环境变量未激活,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.针对这个问题,本文介绍Anaconda Python激活环境变量的方法。

第一,Windows10系统下,按Win+R键启动运行,输入cmd,进入命令窗口,输入conda init,对conda 进行初始化,如果之前做过这步操作,将提示no change.

 Anaconda Python激活环境变量的方法

第二,接着输入python,如果Anaconda Python未激活,将提示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,如下图。

Anaconda Python激活环境变量的方法

第三,开始激活Anaconda Python的环境变量,输入conda info --envs,查看conda 环境变量的路径,如下图,base后边就是环境变量的路径。

Anaconda Python激活环境变量的方法

第四,接着输入conda activate +上述查到的环境变量路径,激活环境变量。

 Anaconda Python激活环境变量的方法

第五,激活环境变量后,再次输入python,就不会提示WarningAnaconda Python激活环境变量的方法了。

第六,如果想停止激活Anaconda Python的环境变量,可以使用conda deactivate命令进行停止激活,如下图。

Anaconda Python激活环境变量的方法

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐