安装Anaconda,命令行输入python,出现“Warning…:This Python interpreter is in a conda environment

以下问题是针对:

“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.

CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’.
If using ‘conda activate’ from a batch script, change your
invocation to ‘CALL conda.bat activate’.

“WARNING: The conda.compat module is deprecated and will be removed in a future release.”

1.我自己是之前安装了Python3.5的版本,又通过Anaconda安装了python2.7的版本,通过:复制一份Anaconda目录下的python.exe的副本在该目录中,并改名为python2.exe;Python35目录下的python.exe同理,复制一份,改为python3.exe,实现cmd或者bash中,python2指令打开python2.7,python3指令打开python3.5

2.上述操作基本完成了两个版本的python的调用,但是可能是因为python2.7是Anaconda附带的,所以需要在Anaconda目录下运行cmd,通过python2才能打开python2.7

3.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
please see https://conda.io/activation

按照网上其他的经验贴,conda activate myenv 或者:1.conda info –envs 然后 conda activate  C:\Users\X_S\Anaconda2 (这是我自己的目录),依旧报错

CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’.
If using ‘conda activate’ from a batch script, change your
invocation to ‘CALL conda.bat activate’.

4.最后在https://github.com/conda/conda/issues/8412 conda的github的issue里面找了解决办法

指令是 activate base  ps:界面和cmd稍有不同,因为我用了cmder(基本和cmd一样,界面好看一点),不过不影响

 

image.png
 

 

image.png
 

 

image.png
 

5.可以发现还是有一个Waring,“WARNING: The conda.compat module is deprecated and will be removed in a future release.”

这个是conda 4.6.11的一个bug ,conda update conda 指令,更新一下conda就没了

 

image.png
  


温馨提示:本文最后更新于2022-12-31 15:55:15,某些文章具有时效性,若有错误或已失效,请在下方留言或联系Yave
------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

原发站点
Yave520-开发者社区
隐私政策
privacy-policy
用户协议
agreement
许可协议
NC-SA 4.0
© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

夸夸
夸夸
还有吗!没看够!
取消
昵称常用语表情代码图片

    暂无评论内容