mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.57k stars 343 forks source link

Different behavior of `conda` and `mamba` installing when dependencies are already installed via `pip` #3258

Open pya opened 3 months ago

pya commented 3 months ago

Troubleshooting docs

Anaconda default channels

How did you install Mamba?

Mambaforge or latest Miniforge

Search tried in issue tracker

pip

Latest version of Mamba

Tried in Conda?

I do not have this problem with Conda, just with Mamba

Describe your issue

Problem

This works with conda

  1. Installing a packages fails du to not available dependencies.
  2. A search shows that the dependency are available on PyPi.
  3. Installing with -c pypi does not work.
  4. Installing the missing dependency with pip works.
  5. Now, conda can install the package.

This is different with mamba

  1. Same as above.
  2. Same as above.
  3. Same as above.
  4. Same as above.
  5. Installing the packages fails again due to not available dependencies, despite the fact that theses dependencies are already installed.

Example

Try to install with mamba

 mamba install <package>

Could not solve for environment specs
The following package could not be installed
└─ <package>  is not installable because it requires
   └─ zodb, which requires
      └─ btrees >=4.2.0 , which does not exist (perhaps a missing channel).

Install the missing package with pip:

pip install zodb

Now mamba shows the insalled packages:

mamba list btrees
# packages in environment at ...
#
# Name                    Version                   Build  Channel
btrees                    5.2                      pypi_0    pypi

mamba list zodb  
# packages in environment at ..
#
# Name                    Version                   Build  Channel
zodb                      5.8.1                    pypi_0    pypi
zodbpickle                3.2                      pypi_0    pypi

But the mamba install failure remains:

 mamba install <package>

Could not solve for environment specs
The following package could not be installed
└─ <package>  is not installable because it requires
   └─ zodb, which requires
      └─ btrees >=4.2.0 , which does not exist (perhaps a missing channel).

Here, conda installs the package without problems.

mamba info / micromamba info

mamba version : 1.5.8
     active environment : dummy
    active env location : /Users/mike/mambaforge/envs/dummy
            shell level : 2
       user config file : /Users/mike/.condarc
 populated config files : /Users/mike/mambaforge/.condarc
                          /Users/mike/.condarc
          conda version : 24.3.0
    conda-build version : 24.3.0
         python version : 3.10.6.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=m1
                          __conda=24.3.0=0
                          __osx=14.3=0
                          __unix=0=0
       base environment : /Users/mike/mambaforge  (writable)
      conda av data dir : /Users/mike/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/hydrocomputing/osx-arm64
                          https://conda.anaconda.org/hydrocomputing/noarch
                          https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/pypi/osx-arm64
                          https://conda.anaconda.org/pypi/noarch
          package cache : /Users/mike/mambaforge/pkgs
                          /Users/mike/.conda/pkgs
       envs directories : /Users/mike/mambaforge/envs
                          /Users/mike/.conda/envs
               platform : osx-arm64
             user-agent : conda/24.3.0 requests/2.31.0 CPython/3.10.6 Darwin/23.3.0 OSX/14.3 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8
                UID:GID : 502:20
             netrc file : None
           offline mode : False

Logs

No response

environment.yml

No response

~/.condarc

channels:
  - hydrocomputing
  - conda-forge
  - pypi

ssl_verify: true
anaconda_upload: true
channel_priority: strict
experimental_sat_error_messages: true
override-channels: true
pip_interop_enabled: true