'Conda-pack: CondaPackError: files managed by conda were

So, I have a python project where all my tests run but then I do:

conda install -y conda-pack

which succeeds and when I run:

conda-pack

I get a lengthy complaint:

Collecting packages...
CondaPackError: 
Files managed by conda were found to have been deleted/overwritten in the
following packages:

- conda-pack 0.6.0:
    lib/python3.1/site-packages/conda_pack-0.6.0.dist-info/INSTALLER
    lib/python3.1/site-packages/conda_pack-0.6.0.dist-info/LICENSE.txt
    lib/python3.1/site-packages/conda_pack-0.6.0.dist-info/METADATA
    + 19 others
- types-requests 2.26.0:
    lib/python3.1/site-packages/requests-stubs/METADATA.toml
    lib/python3.1/site-packages/requests-stubs/__init__.pyi
    lib/python3.1/site-packages/requests-stubs/adapters.pyi
    + 41 others
- jsonschema 4.2.1:
    lib/python3.1/site-packages/jsonschema-4.2.1.dist-info/COPYING
    lib/python3.1/site-packages/jsonschema-4.2.1.dist-info/INSTALLER
    lib/python3.1/site-packages/jsonschema-4.2.1.dist-info/METADATA
    + 39 others
- types-setuptools 57.4.2:
    lib/python3.1/site-packages/pkg_resources-stubs/METADATA.toml
    lib/python3.1/site-packages/pkg_resources-stubs/__init__.pyi
    lib/python3.1/site-packages/pkg_resources-stubs/py31compat.pyi
    + 56 others
<snip>

I see no issues in conda list and I can still run my tests. I see no issues with my environment. Ideas?



Solution 1:[1]

This should be related to this issue: https://github.com/conda/conda-pack/issues/198

The root cause is that the image is trying to use python3.10 and conda-pack parse it as python3.1.

They claimed to have fixed it in conda-pack 0.7.0 (release note) but I was using 0.7.0 and still see this problem.

One workaround is to specify another python version in a new env:

conda create -n new_env python=3.9 ${other_packages}
conda install conda-pack

conda-pack -n new_env ${your_other_options}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fei