conda 环境迁移

发布时间:2022-08-17 14:36

Anaconda 环境迁移

  1. install conda pack
conda install conda-pack
  1. make sure the local envs is activated
  2. pack local packages
conda pack -n my_env -o output_name.tar.gz

Notes: if show following errors

CondaPackError: Cannot pack an environment with editable packages
installed (e.g. from python setup.py develop or
pip install -e). Editable packages found:

sloved by adding --ignore-editable-packages, such as the following script

conda pack -n my_env -o output_name.tar.gz --ignore-editable-packages
  1. unpack the packages in new envs
mkdir -p some_env
tar -xzf output_name.tar.gz -C some_env
  1. activate envs
source some_env/bin/activate
  1. checking the python version in new envs
./some_env/bin/python

ItVuer - 免责声明 - 关于我们 - 联系我们

本网站信息来源于互联网,如有侵权请联系:561261067@qq.com

桂ICP备16001015号