astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.03k stars 594 forks source link

Unable to install pyre2 with uv #6084

Closed sgrimee closed 1 day ago

sgrimee commented 1 month ago

Unable to install pyre2 with uv pip, it works with pip directly.

On mac, in a nix environment with python 3.12.4 and uv 0.1.45. Using a venv created by uv.

Trying to install pyre2:

uv pip install pyre2==0.3.6          
Resolved 1 package in 2ms
error: Failed to download distributions
  Caused by: Failed to fetch wheel: pyre2==0.3.6
  Caused by: Failed to build: `pyre2==0.3.6`
  Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1
--- stdout:
running bdist_wheel
running build
running build_ext
-- Configuring incomplete, errors occurred!
--- stderr:
CMake Error at CMakeLists.txt:3 (project):
  Running

   '/Users/sgrimee/Library/Caches/uv/.tmpRpC52h/.venv/bin/ninja' '--version'

  failed with:

   no such file or directory

It also fails if I first install:

uv pip install ninja setuptools wheel
Resolved 3 packages in 2ms
Installed 3 packages in 11ms
 + ninja==1.11.1.1
 + setuptools==72.2.0
 + wheel==0.44.0
charliermarsh commented 1 month ago

It looks like you might need --no-build-isolation?

charliermarsh commented 1 month ago

See: https://github.com/astral-sh/uv/blob/main/PIP_COMPATIBILITY.md#pep-517-build-isolation

sgrimee commented 1 month ago

Thanks for the response! So I try from a fresh venv, I install setuptools and ninja, then:

uv pip install --no-build-isolation  pyre2==0.3.6 
Resolved 1 package in 0.94ms
error: Failed to download distributions
  Caused by: Failed to fetch wheel: pyre2==0.3.6
  Caused by: Failed to build: `pyre2==0.3.6`
  Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1
--- stdout:
running bdist_wheel
running build
running build_ext
-- Configuring incomplete, errors occurred!
--- stderr:
CMake Error at CMakeLists.txt:3 (project):
  Running

   '/Users/sgrimee/Library/Caches/uv/.tmpRpC52h/.venv/bin/ninja' '--version'

  failed with:

   no such file or directory
charliermarsh commented 1 month ago

Hmm, this works as expected for me:

❯ uv venv

❯ uv pip install setuptools ninja cython

❯ uv pip install --no-build-isolation  pyre2==0.3.6
Resolved 1 package in 1ms
   Built pyre2==0.3.6
Prepared 1 package in 3.23s
Installed 1 package in 0.64ms
 + pyre2==0.3.6
sgrimee commented 1 month ago

thanks for checking... are you on python 3.12? I still see the error, and had a colleague test it to, but I see it only on 3.12. With 3.9-11, I get another error, I think not related, which I am trying to solve also by upgrading my c++ to v17. Would you mind sharing your python version, as well as c++ version you are using?

charliermarsh commented 1 month ago

@sgrimee -- I just tested and it succeeds for me on both Python 3.11 and Python 3.12, unfortunately.

charliermarsh commented 1 day ago

Gonna close due to difficulty reproducing.