网上给出的方案错误百出,记录一下正确方案。
1 创建yaml文件
创建到终端所在路径下
conda activate 环境名
conda env export --no-build >环境名.yaml
2 新操作系统中创建新的conda环境
conda env create -f 环境名.yaml
3 删除不兼容的包
终端报错
Could not solve for environment specs
The following packages are incompatible
├─ ucrt 10.0.22621.0** does not exist (perhaps a typo or a missing channel);
├─ vc 14.2** does not exist (perhaps a typo or a missing channel);
├─ vc14_runtime 14.38.33130** does not exist (perhaps a typo or a missing channel);
├─ vs2015_runtime 14.38.33130** does not exist (perhaps a typo or a missing channel);
└─ win_inet_pton 1.1.0** is not installable because it requires└─ __win, which is missing on the system.
删除这些