离线环境conda虚拟环境备份迁移--conda pack问题

1.第一步:创建虚拟环境


conda create -n pyenv --clone base 
或者
conda create -n pyenv python==3.8.5 --offline

命令执行结束,在路径/xxxx/anaconda/envs 下看到pyenv
或者 conda info --envs 查看罗列虚拟环境

2.第二步:打包环境


conda pack -n pyenv -o /xxxxx/pyenv.tar.gz

报错:
Collecting packages...
CondaPackError: 
Files managed by conda were found to have been deleted/overwritten in the
following packages:

- python='3.8.5'

This is usually due to `pip` uninstalling or clobbering conda managed files,
resulting in an inconsistent environment. Please check your environment for
conda/pip conflicts using `conda list`, and fix the environment by ensuring
only one version of each package is installed (conda preferred).


网上搜一圈,没有能解决问题的,最后得重装虚拟环境,费时费力

我的办法:
直接把/xxxx/anaconda/envs 下的pyenv打包压缩即可zip -r  pyenv.zip /xxxx/anaconda/envs/pyenv

3.第三步:激活环境


将pyenv.zip 拷贝到另外一个系统上并解压到目录下/xxxx/anaconda/envs/

unzip -d /xxxx/anaconda/envs/  pyenv.zip

然后激活环境 source activate /xxxx/anaconda/envs/pyenv


亲测在linux 64 系统上可用!!
 

你可能感兴趣的:(conda,windows,人工智能,python)