乐趣区

关于conda:conda-环境迁移

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
退出移动版