在jupyter中有python3.7的基础上,想要再加个2.7. 按照各种教程 先创建虚拟环境, 安装python=2.7后 执行
conda install ipykernel
会出现报错:
ERROR conda.core.link:_execute(699): An error occurred while installing package 'defaults::ipykernel
按照这个报错浏览各个网站,各种尝试,均没有解决问题(包括设置环境变量,更新conda,卸载各种包又重装各种包…)
遂看一下里面其他报错信息,往上翻还有:
(python27) C:\Users\hy8999>conda install ipykernel
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
两个Solving environment都是failed。
第一个:
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
网上的解决方法仍不适用。
第二个:
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
解决办法办法见链接 按照程序修改清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
————————————————
版权声明:本文为CSDN博主「princemrgao」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/princemrgao/article/details/105705423
而后,conda install ipykernel 即可成功。 重启jupyter,已有python2:
|