Skip to content

uv fails to install scikits.odes on Python 3.11 due to Cython dependency resolution mismatch, works on Python 3.10 and earlier (cannot find longintrepr.h?) #2646

@agriyakhetarpal

Description

@agriyakhetarpal

Description

Hi there! I'm opening this issue because I'm unable to install a package with uv, but the installation works with pip – it's called scikits.odes. The installation instructions mention the requirement of a Fortran compiler and a SUNDIALS installation present before installing off of the source distribution available on PyPI (no wheels are available).

How to reproduce

Here is a reproducer on an M-series macOS machine (compiling scikits.odes is much easier on Unix-like platforms such as GNU/Linux and macOS, rather than on Windows).

Note

Installing SUNDIALS via Homebrew usually works, but it doesn't work at the time of writing because the formula was updated to SUNDIALS v7.0.0, which is not supported (we regularly test in CI against v6.5.0). I have provided another method of installing SUNDIALS v6.5.0 for the purpose of this MWE.

# install Python 3.11 with Homebrew
brew install [email protected]
# Clone repository (we provide a helper script to install SUNDIALS
git clone https://github.com/pybamm-team/PyBaMM.git --depth 1
# Create a virtual environment in venv/
python3.11 -m venv venv
# Activate it
source venv/bin/activate
# Install SUNDIALS v6.5.0 via helper script, to ~/.local/
pip install nox
nox -s pybamm-requires
# Install uv into this virtual environment via pip
pip install uv
# Point to the SUNDIALS installation directory before installation
export SUNDIALS_INST="$HOME/.local/"
# Install it
uv pip install scikits.odes --verbose --no-cache-dir

Expected behaviour

The expected behaviour would be that I can install scikits.odes with uv on both Python 3.10 and Python 3.11 (or between Python 3.8–3.11 based on the provided official support for the package). I can currently install scikits.odes with pip on all Python versions from 3.8–3.11.

Additional context

I see that #1946 faced this issue of not being able to find longintrepr.h earlier, I don't know if that's related – I am not used to working with Cython or Fortran codebases, but can help debug a bit with pybind11 linkage. However, I'm noticing with a deeper dive with the logs that pip's resolver chooses to point to cython==0.29.37, while uv chooses cython==3.0a7, which might be causing the trouble?

I would be happy to provide additional reproducers or logs as necessary.

xref: pybamm-team/PyBaMM#3825, aio-libs/aiohttp#6600

Specifications

uv 0.1.24 (a5cae0292 2024-03-22) installed via pip from PyPI
macOS M-series, running Mac OS X Sonoma v14.3 (arm64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions