当前位置:   article > 正文

2021-06-01Anaconda建立新的python环境(建立时出错、建立“成功”但是没有python.exe文件)_please update conda by running

please update conda by running

利用Anaconda建立新的python环境时,踩的坑

conda create -n myenv python:
报错:
Warning: A newer version of conda exists.
current version: 4.9.2
latest version:4.10.1
Please update conda by running
$ conda update -n base conda
想法:
并没有打算直接运行它给的命令去更新conda,因为一旦更新conda会更惨、问题更多,除非官方建议。造成这个原因,猜测可能是某些包损坏了,需要把那些包剔除掉,然后再载回来,具体操作如下。
解决方法:

  1. 更改.condarc文件(这步可以先跳过,因为我在解决之前试过、改过很多东西,所以这边参考别人blog的一点操作)
ssl_verify: true
show_channel_urls: true

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

.condarc文件原先的写法是参考清华开源软件镜像站

channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  1. 清理损坏包
conda clean --packages --tarballs
  • 1
  1. 再载回来
conda update --all
  • 1
  1. 再重新运行“conda create -n myenv python”,成功。

自己记录一下,希望也可以给大家当个参考。


命令记录:

conda clean -p	//删除无用包
conda clean -i	//清除索引缓存,保证用的是镜像站提供的索引。
  • 1
  • 2

清华大学开源软件镜像站

参考文献:

https://blog.csdn.net/qq_42658739/article/details/105019173

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/一键难忘520/article/detail/890046
推荐阅读
相关标签
  

闽ICP备14008679号