想要训练模型在创建虚拟环境时却一直报错,查阅资料得知可以直接使用conda clean --all 清除缓存,但是对我除了清理出了6个多G的内存外好像没什么用,还是一直出现下面的错误,
Preparing transaction: done
Verifying transaction: failed
CondaVerificationError: The package for setuptools located at x\xxx\xxx\anaconda3\pkgs\setuptools-65.6.3-py37haa95532_0
appears to be corrupted. The path 'Lib/site-packages/setuptools/script (dev).tmpl'
specified in the package manifest cannot be found.
CondaVerificationError: The package for setuptools located at x\xxx\xxx\anaconda3\pkgs\setuptools-65.6.3-py37haa95532_0
appears to be corrupted. The path 'Lib/site-packages/setuptools/script.tmpl'
specified in the package manifest cannot be found.
想着应该是setuptools这个包损坏了,然后删除了之后再强制重新装也没解决,更新conda也没有什么用,最后没办法就直接去\anaconda3\pkgs文件夹下直接删除了可能损坏的
\anaconda3\pkgs\setuptools-65.6.3-py37haa95532_0
也就是报错中说的那个文件,(还要记得去删envs里面之前尝试创建虚拟环境失败的那个虚拟环境名对应的文件夹),再次运行创建环境的那条指令,问题得以解决,环境创建成功。
ps:没解决问题但是意外发现了, conda clean --all是清除conda缓存,他清理了conda缓存目录中下载的包文件、索引文件、和不必要的缓存文件,释放了空间,对于其他已经创建好的环境没有什么直接影响。对于这个问题没用但是可以清除出来好多内存哇,也算是额外收获了