conda-forge / poetry-feedstock

A conda-smithy repository for poetry.
BSD 3-Clause "New" or "Revised" License
3 stars 13 forks source link

Unable to install on Linux #84

Closed drhagen closed 1 year ago

drhagen commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

I cannot install version 1.3.2 of this package alongside Python 3.11, at least not on Linux.

mamba create --name temp python=3.11 poetry=1.3.2

The mamba error suggests that __osx is erroneously being listed as a dependency.

Looking for: ['python=3.11', 'poetry=1.3.2']

conda-forge/linux-64                                        Using cache
conda-forge/noarch                                          Using cache
Encountered problems while solving:
  - nothing provides __osx needed by poetry-1.3.2-osx_pyhd8ed1ab_0

Strangely, it installs just fine if I specify Python 3.10. These lines in the recipe listing __osx as a mandatory runtime dependency are a little funky, but the comment suggests they were added intentionally.

Installed packages

N/A

Environment info

active environment : temp
    active env location : /home/david/anaconda/envs/temp
            shell level : 2
       user config file : /home/david/.condarc
 populated config files : /home/david/anaconda/.condarc
          conda version : 22.11.1
    conda-build version : not installed
         python version : 3.10.8.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=11.4=0
                          __glibc=2.31=0
                          __linux=5.15.0=0
                          __unix=0=0
       base environment : /home/david/anaconda  (writable)
      conda av data dir : /home/david/anaconda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/david/anaconda/pkgs
                          /home/david/.conda/pkgs
       envs directories : /home/david/anaconda/envs
                          /home/david/.conda/envs
               platform : linux-64
             user-agent : conda/22.11.1 requests/2.28.1 CPython/3.10.8 Linux/5.15.0-58-generic ubuntu/20.04.5 glibc/2.31
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
BastianZim commented 1 year ago

The __osx error is a red herring, caused by the solver going down the wrong path. Can you please enable the new, experimental, solver message and try again?

https://medium.com/@AntoineProuvost/managing-conflicts-with-mamba-6a5fa10ed6a

maresb commented 1 year ago

I can confirm this, and I just tried adding that flag and it didn't result in any different output.

maresb commented 1 year ago

Dockerized reproducer:

docker run --rm -it mambaorg/micromamba:1.3.1
echo "experimental_sat_error_message: true" >> ~/.condarc
micromamba create -c conda-forge -n issue-84 python=3.11 poetry=1.3.2

But this time I got debugging output:

    ================== Experimental satisfiability error messages ==================
    You are seeing this because you set `experimental_sat_error_message: true`
    Use the following issue to share feedback on this experimental feature
       https://github.com/mamba-org/mamba/issues/2078

    ====================================== Legacy messages (old) =======================================
    Encountered problems while solving:
      - nothing provides __osx needed by poetry-1.3.2-osx_pyhd8ed1ab_0

    The environment can't be solved, aborting the operation
    =================================== Experimental messages (new) ====================================
    The following packages are incompatible
    ├─ poetry 1.3.2** * is installable with the potential options
    │  ├─ poetry 1.3.2 would require
    │  │  └─ importlib-metadata >=4.4,<5.0 * with the potential options
    │  │     ├─ importlib-metadata [4.10.0|4.10.1|...|4.9.0] would require
    │  │     │  └─ python_abi 3.10.* *_cp310 with the potential options
    │  │     │     ├─ python_abi 3.10, which can be installed;
    │  │     │     └─ python_abi 3.10 would require
    │  │     │        └─ python 3.10.* *_cpython, which can be installed;
    │  │     ├─ importlib-metadata [4.10.0|4.10.1|...|4.9.0] would require
    │  │     │  └─ python_abi 3.7.* *_cp37m with the potential options
    │  │     │     ├─ python_abi 3.7, which can be installed;
    │  │     │     └─ python_abi 3.7 would require
    │  │     │        └─ python 3.7.* *_cpython, which can be installed;
    │  │     ├─ importlib-metadata [4.10.0|4.10.1|...|4.9.0] would require
    │  │     │  └─ python_abi 3.7 *_pypy37_pp73, which requires
    │  │     │     └─ python 3.7.* *_73_pypy, which can be installed;
    │  │     ├─ importlib-metadata [4.10.0|4.10.1|...|4.9.0] would require
    │  │     │  └─ python_abi 3.8.* *_cp38 with the potential options
    │  │     │     ├─ python_abi 3.8, which can be installed;
    │  │     │     └─ python_abi 3.8 would require
    │  │     │        └─ python 3.8.* *_cpython, which can be installed;
    │  │     ├─ importlib-metadata [4.10.0|4.10.1|...|4.9.0] would require
    │  │     │  └─ python_abi 3.9.* *_cp39 with the potential options
    │  │     │     ├─ python_abi 3.9, which can be installed;
    │  │     │     └─ python_abi 3.9 would require
    │  │     │        └─ python 3.9.* *_cpython, which can be installed;
    │  │     ├─ importlib-metadata [4.11.3|4.11.4] would require
    │  │     │  └─ python_abi 3.8 *_pypy38_pp73, which requires
    │  │     │     └─ python 3.8.* *_73_pypy, which can be installed;
    │  │     ├─ importlib-metadata [4.11.3|4.11.4] would require
    │  │     │  └─ python_abi 3.9 *_pypy39_pp73, which requires
    │  │     │     └─ python 3.9.* *_73_pypy, which can be installed;
    │  │     ├─ importlib-metadata [4.4.0|4.5.0|...|4.8.1] would require
    │  │     │  └─ python_abi 3.6.* *_cp36m, which can be installed;
    │  │     └─ importlib-metadata [4.4.0|4.5.0] would require
    │  │        └─ python_abi 3.6 *_pypy36_pp73, which requires
    │  │           └─ python 3.6.* *_73_pypy, which can be installed;
    │  ├─ poetry 1.3.2 would require
    │  │  └─ __osx * *, which is missing on the system;
    │  └─ poetry 1.3.2 would require
    │     └─ __win * *, which is missing on the system;
    └─ python 3.11** * is uninstallable because it requires.
    ====================================================================================================

critical libmamba Could not solve for environment specs
drhagen commented 1 year ago

For completion, I updated to the latest mamba and enabled the experimental solver. (I thought the experimental solver was mamba, which was only experimental on conda, but whatever). Doing this did not change the output. That being said, @maresb's output suggests that it is actually a missing python_abi upload for 3.11 that importlib-metadata needs, and @BastianZim was right about __osx being a red herring.

maresb commented 1 year ago

Ya, thanks for pointing that out. I didn't notice on first glance.

micromamba create -c conda-forge -n issue-84 python=3.11 "importlib-metadata >4.4,<5.0"

is the root cause.

drhagen commented 1 year ago

Hmm, Poetry is not supposed to need importlib-metadata for Python 3.10 and 3.11, and there is no upper bound on that package regardless. Presumably, there is a reason why this is more restrictive in conda-forge, but I can't find the discussion.

maresb commented 1 year ago

Probably this was done to make it noarch.

maresb commented 1 year ago

Potential solution in https://github.com/conda-forge/importlib_metadata-feedstock/pull/115

BastianZim commented 1 year ago

Hmm, Poetry is not supposed to need importlib-metadata for Python 3.10 and 3.11, and there is no upper bound on that package regardless. Presumably, there is a reason why this is more restrictive in conda-forge, but I can't find the discussion.

Yes, that’s because of noarch. We should remove that upper bound though.

I’m on mobile but can try to put in a PR over the next few days, if the other approach doesn’t work.

xylar commented 1 year ago

Hmm, Poetry is not supposed to need importlib-metadata for Python 3.10 and 3.11, and there is no upper bound on that package regardless.

@drhagen You are looking at the master branch but if you look at the latest release tag, there is an upper bound:

https://github.com/python-poetry/poetry/blob/1.3.2/pyproject.toml#L59

We should remove that upper bound though.

@BastianZim, I think we need to wait for a new release for that. If we try to drop the upper bound on this release, it will not pass pip check.

@maresb, thank you very much for your solution! Building the latest importlib-metadata < 5 is very much the correct solution here.

BastianZim commented 1 year ago

@BastianZim, I think we need to wait for a new release for that. If we try to drop the upper bound on this release, it will not pass pip check.

Yes you're right, I didn't see the master. Sorry, shouldn't review on my phone. :)

maresb commented 1 year ago

I think we solved this. It works for me in Docker, but I haven't tested thoroughly. Is everything working now @drhagen?

drhagen commented 1 year ago

I can confirm that Poetry 1.3.2 can be installed on Python 3.11. Thanks everybody!