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

系统 7984 0

以下问题是针对:

“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  


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论