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

micromamba/conda compatibility mode cannot work before setting conda config --set add_pip_as_python_dependency false #102

Closed
e8035669 opened this issue Feb 23, 2025 · 5 comments · Fixed by #103

Comments

@e8035669
Copy link

Hello, I found micromamba compatibility mode cannot work, because conda will add pip as dependency of python by default, but pixi don't.

Steps to reproduce:

pixi init
pixi add python=3.12
pixi-pack pack

mkdir environment && cd environment
tar -xvf ../environment.tar
micromamba create -p ./env --file environment.yml

and then get the error

error    libmamba Could not solve for environment specs
    The following package could not be installed
    └─ python =3.12.9 h9e4cc4f_0_cpython is not installable because it requires
       └─ pip =* *, which does not exist (perhaps a missing channel).
critical libmamba Could not solve for environment specs

if you set add_pip_as_python_dependency config to conda, it will work as expect.

conda config --set add_pip_as_python_dependency false

The document to this config is here, it is default to True.

@e8035669
Copy link
Author

e8035669 commented Feb 23, 2025

By the way, I still unable to restore environment with conda

conda env create -p ./env --file environment.yml
Channels:
 - file:///home/jeff/project/temp/test1/environment/channel
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - libexpat==2.6.4=h5888daf_0

Current channels:

  - file:///home/jeff/project/temp/test1/environment/channel

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

but libexpat file is actually exists

$ ls channel/linux-64/libexpat-2.6.4-h5888daf_0.conda
channel/linux-64/libexpat-2.6.4-h5888daf_0.conda

and exist in repodata.json

$ grep 'libexpat' channel/linux-64/repodata.json

    "libexpat-2.6.4-h5888daf_0.conda": {
      "name": "libexpat",
        "libexpat >=2.6.4,<3.0a0",

I think this problem is from conda, because micromamba works.

$ conda --version
conda 25.1.1

$ micromamba --version
2.0.5

@pavelzw
Copy link
Member

pavelzw commented Feb 23, 2025

because conda will add pip as dependency of python by default, but pixi don't

this is a conda/micromamba skill issue tbh, imo it doesn't make any sense from a packaging perspective to have additional specific behavior for a single package to then include another package.

you can work around this by either fixing your conda/micromamba configuration (as you mentioned) or by adding pip to your pixi project as well.

the only thing to be done here is to maybe mention this odd behavior of conda/mamba in the documentation


By the way, I still unable to restore environment with conda

could you send me a reproducer pixi.toml and pixi.lock? But yes, this sounds like a conda issue...

@e8035669
Copy link
Author

the only thing to be done here is to maybe mention this odd behavior of conda/mamba in the documentation

Yes, I think remind users to set conda configuration or add pip into pixi project is enough.

could you send me a reproducer pixi.toml and pixi.lock? But yes, this sounds like a conda issue...

You need the reproducer that contains conda, pixi and pixi-pack packages?

@pavelzw
Copy link
Member

pavelzw commented Feb 23, 2025

for the docs update, see #103

You need the reproducer that contains conda, pixi and pixi-pack packages?

i couldn't reproduce your libexpat==2.6.4=h5888daf_0 not found error. Can you send me the pixi.lock that was used during pixi-pack packing the environment.tar?
The one i tried with pixi init && pixi add python=3.12 works with conda.

@e8035669
Copy link
Author

for the docs update, see #103

That's great, thank you.

Sorry, I just try again and conda is work, too.
Maybe I messed something a few hours ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants