Anaconda 环境迁徙
- install conda pack
conda install conda-pack
- make sure the local envs is activated
- 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. frompython 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
- unpack the packages in new envs
mkdir -p some_env
tar -xzf output_name.tar.gz -C some_env
- activate envs
source some_env/bin/activate
- checking the python version in new envs
./some_env/bin/python