离线环境迁移conda

有时候需要在离线环境下更新python依赖库版本,这时可以用conda迁移.

步骤:

  1. 复制要克隆的conda环境到离线主机中;
  2. 复制pkgs目录到离线主机中;
  3. 创建克隆环境;

补充说明:

        conda安装目录"~/anaconda3"与"~/.conda"配置是通用的,如"~/anaconda3/envs"与"~/.conda/envs","~/anaconda3/pkgs"与"~/.conda/pkgs"都会生效;在复制的时候需要根据时间等条件去判断那个才是最终的

(1)

        如克隆py37环境,"scp -r ~/.conda/envs/py37  用户@ip:临时路径/" 

 (2)

        "scp -r ~/.conda/pkgs  用户@ip:~/.conda" 

(3)        

        "conda create -n py37 --clone 临时路径/py37 --offline"

        如出现一下类型错误如"_openmp_mutex",在"~/.conda/pkgs"目录中,通过删除对应文件后重新解压.

        

conda create -n py37 --clone ./py37 --offline


Preparing transaction: done
Verifying transaction: failed

CondaVerificationError: The package for _openmp_mutex located at ~/.conda/pkgs/_openmp_mutex-4.5-1_gnu
appears to be corrupted. The path 'lib/libgomp.so.1'
specified in the package manifest cannot be found.

CondaVerificationError: The package for python located at ~/.conda/pkgs/python-3.7.10-h12debd9_4
appears to be corrupted. The path 'compiler_compat/ld'
specified in the package manifest cannot be found.

ClobberError: The package 'https://mirrors.ustc.edu.cn/anaconda/pkgs/main::ncurses-6.2-he6710b0_1' cannot be installed due to a
path collision for 'lib/terminfo'.
This path already exists in the target prefix, and it won't be removed
by an uninstall action in this transaction. The path is one that conda
doesn't recognize. It may have been created by another package manager.

                               

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值