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

系统 251 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一样,界面好看一点),不过不影响

安装Anaconda,命令行输入python,出现“Warning:This Python interpreter is in a conda environment,but the envir_第1张图片

安装Anaconda,命令行输入python,出现“Warning:This Python interpreter is in a conda environment,but the envir_第2张图片

安装Anaconda,命令行输入python,出现“Warning:This Python interpreter is in a conda environment,but the envir_第3张图片

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就没了

安装Anaconda,命令行输入python,出现“Warning:This Python interpreter is in a conda environment,but the envir_第4张图片

 

 

 


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

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请请扫描上面二维码支持博主1元、2元、5元等您想捐的金额吧,狠狠点击下面给点支持吧

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