5

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?

Kurt
  • 399
  • 3
  • 14
  • `python3.1` - really? I didn't think Conda even existed when Python v3.1 was active. Are you installing `conda-pack` in the same env you are trying to pack? Are there any non-Conda packages in the environment (e.g., `conda list` shows channel as `pypi`)? – merv Nov 16 '21 at 18:49

3 Answers3

4

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}
Fei
  • 1,906
  • 20
  • 36
1

I think the problem is still there in conda-pack 0.7.0 in the unix-world and will only appear for python 3.10 and upward. It might be dependent on the conda version, but many users do not have the rights to update conda (as is the case for me). Reason are the symbolic links generated by python, which direct python 3.1 packages/programs to python 3.10. Conda-pack does not understand that correctly und searches for python3.1 files.

Solution is a) to update conda if possible b) if that fails to exclude those python3.1 references (running conda-pack in the environment, say myenv, you want to pack - will generate myenv.tar.gz):

conda-pack -f --ignore-missing-files --exclude lib/python3.1
Rriskit
  • 495
  • 4
  • 15
0

It might be that the files installed by pip have overridden those installed by conda, causing conflicts. Reinstalling the conflicting packages with conda should resolve the problem. For example:

conda install conda-pack==0.6.0