正常打包命令
conda pack -n 自己的虚拟环境名 -o output_name.tar.gz
示例:
conda pack -n dassl -o dasslEnv.tar.gz
出现报错1
(base) @:~$ conda pack -n dassl -o output.tar.gz
Collecting packages...
CondaPackError: Cannot pack an environment with editable packages
installed (e.g. from `python setup.py develop` or
`pip install -e`). Editable packages found:
- /home/data/******/Dassl.pytorch
问题解决
忽略可编辑的包
conda pack -n dassl -o dasslEnv.tar.gz --ignore-editable-packages
出现报错2
Collecting packages...
CondaPackError:
Files managed by conda were found to have been deleted/overwritten in the
following packages:
- setuptools 69.5.1:
lib/python3.8/site-packages/setuptools/__pycache__/dep_util.cpython-38.pyc
lib/python3.8/site-packages/setuptools/_distutils/__pycache__/py38compat.cpython-38.pyc
lib/python3.8/site-packages/setuptools/_distutils/py38compat.py
lib/python3.8/site-packages/setuptools/dep_util.py
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).
问题解决
忽略掉包版本不合适的问题
conda pack -n dassl -o dasslEnv.tar.gz --ignore-editable-packages
导出pip list
pip freeze > ./requirements.txt
导入
pip install -r ./requirements.txt