Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conda-pack: CondaPackError: files managed by conda were #196

Closed
waveskimmer opened this issue Nov 16, 2021 · 5 comments
Closed

Conda-pack: CondaPackError: files managed by conda were #196

waveskimmer opened this issue Nov 16, 2021 · 5 comments
Labels
locked [bot] locked due to inactivity

Comments

@waveskimmer
Copy link

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
      `

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

Any Ideas?

@waveskimmer
Copy link
Author

I've been struggling with this the last 24 hours or so. I'm using python 3.9.7 on a Mac. Here are a few more findings:

First, if I install it into the base environment on a fresh install, I get this error:

(base) ➜  vl-headlands-file git:(make_conda) ✗ conda-pack
Collecting packages...
CondaPackError: 
Files managed by conda were found to have been deleted/overwritten in the
following packages:

- python.app 3:
    pythonapp/Contents/Info.plist
    pythonapp/Contents/MacOS/python
    pythonapp/Contents/PkgInfo
    + 4 others

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).

Second, If try to create an environment with anything else, then I see my original error. For example,

name: testenv
channels:
  - conda-forge

dependencies:
  - conda-pack
  - fastapi

And, I get.

(base) ➜  vl-headlands-file git:(make_conda) ✗ conda env create -f test-env.yaml 
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate testenv
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) ➜  vl-headlands-file git:(make_conda) ✗ conda activate testenv
(testenv) ➜  vl-headlands-file git:(make_conda) ✗ conda-pack 
Collecting packages...
CondaPackError: 
Files managed by conda were found to have been deleted/overwritten in the
following packages:

- wheel 0.37.0:
    lib/python3.1/site-packages/wheel-0.37.0-py3.9.egg-info/PKG-INFO
    lib/python3.1/site-packages/wheel-0.37.0-py3.9.egg-info/SOURCES.txt
    lib/python3.1/site-packages/wheel-0.37.0-py3.9.egg-info/dependency_links.txt
    + 20 others
- pip 21.3.1:
    lib/python3.1/site-packages/pip-21.3.1-py3.9.egg-info/PKG-INFO
    lib/python3.1/site-packages/pip-21.3.1-py3.9.egg-info/SOURCES.txt
    lib/python3.1/site-packages/pip-21.3.1-py3.9.egg-info/dependency_links.txt
    + 412 others
- 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
- starlette 0.16.0:
    lib/python3.1/site-packages/starlette-0.16.0.dist-info/INSTALLER
    lib/python3.1/site-packages/starlette-0.16.0.dist-info/LICENSE.md
    lib/python3.1/site-packages/starlette-0.16.0.dist-info/METADATA
    + 37 others
- fastapi 0.70.0:
    lib/python3.1/site-packages/fastapi-0.70.0.dist-info/INSTALLER
    lib/python3.1/site-packages/fastapi-0.70.0.dist-info/LICENSE
    lib/python3.1/site-packages/fastapi-0.70.0.dist-info/METADATA
    + 46 others
- idna 3.1:
    lib/python3.1/site-packages/idna-3.1.dist-info/INSTALLER
    lib/python3.1/site-packages/idna-3.1.dist-info/LICENSE.md
    lib/python3.1/site-packages/idna-3.1.dist-info/METADATA
    + 13 others
- typing_extensions 3.10.0.2:
    lib/python3.1/site-packages/typing_extensions-3.10.0.2.dist-info/INSTALLER
    lib/python3.1/site-packages/typing_extensions-3.10.0.2.dist-info/LICENSE
    lib/python3.1/site-packages/typing_extensions-3.10.0.2.dist-info/METADATA
    + 6 others

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).

Third, if I install conda-pack in a new environment with nothing else installed, I get the expected results:

✗ conda-pack Collecting packages... Packing environment at '/Users/kurt.guenther.ext/miniconda3/envs/debug-env' to 'debug-env.tar.gz' [########################################] | 100% Completed | 41.2s

I think I can work this this as I can pass in an env from the command-line.

@waveskimmer
Copy link
Author

Wow! I think I finally nailed it. The lib/python3.1 was actually symlinked to a lib/python3.10, so the whole python3.1 was a red herring. If I added python=3.9 to my environment, it works as designed. Almost too much for a conda newbie, but I did learn a lot on the journey.

I still think there is something wrong above.

@geoHeil
Copy link

geoHeil commented Nov 30, 2021

#197 might be related.

I am facing a similar problem.

And can confirm that pinning the python version in the environment.yml file like i.e. python=3.8 is working.

@dbast
Copy link
Member

dbast commented Jan 24, 2022

This got fixed by #199 ... which is part of the released conda-pack version 0.7.0 (currently available via conda-forge).

The above commands as one liner to test run successful here:

conda create --name testenv -c conda-forge conda-pack fastapi -y && conda activate testenv && conda-pack

See also #200

@dbast dbast closed this as completed Jan 24, 2022
@orsk-moscow
Copy link

orsk-moscow commented Feb 15, 2022

Hello!

I still have the same bug. Simple check with @dbast's cmd:
conda create --name testenv -c conda-forge conda-pack fastapi -y && conda activate testenv && conda-pack got me the error:

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

conda-pack --version
conda-pack 0.7.0

UPD
simple modification cmd to conda create -y -n testenv -c conda-forge conda-pack fastapi python=3.9 && conda activate testenv && conda-pack helped, but looks like fix doesn't handle the bug

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Feb 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests

4 participants