Isotr0py / pillow-jpegxl-plugin

Pillow plugin for JPEG-XL, using Rust for bindings.
MIT License
15 stars 3 forks source link

Problem installing via pip - outdated dependency #47

Closed pearcetm closed 4 weeks ago

pearcetm commented 1 month ago

I'm trying to install this library using pip install pillow-jxl-plugin and getting the error below. From the error it looks like the plugin depends on jpegxl-src v0.10.2 which appears to have been yanked:

image

I'm not sure exactly where this version number is specified as a dependency.

Here's the full error:

> pip install pillow-jxl-plugin
Collecting pillow-jxl-plugin
  Using cached pillow_jxl_plugin-1.2.4.tar.gz (240 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
          Updating crates.io index
      error: failed to get `jpegxl-src` as a dependency of package `jpegxl-sys v0.10.2+libjxl-0.10.2 (/private/var/folders/w8/m4st6m2j6vn3l2wdw83gj60m0000gp/T/pip-install-k9kqq3ux/pillow-jxl-plugin_d0d7e5cf120943aaaf3babcda3d40a5d/jpegxl-rs/jpegxl-sys)`
          ... which satisfies path dependency `jpegxl-sys` (locked to 0.10.2+libjxl-0.10.2) of package `jpegxl-rs v0.10.2+libjxl-0.10.2 (/private/var/folders/w8/m4st6m2j6vn3l2wdw83gj60m0000gp/T/pip-install-k9kqq3ux/pillow-jxl-plugin_d0d7e5cf120943aaaf3babcda3d40a5d/jpegxl-rs/jpegxl-rs)`
          ... which satisfies path dependency `jpegxl-rs` (locked to 0.10.2+libjxl-0.10.2) of package `pillow-jxl-plugin v1.2.4 (/private/var/folders/w8/m4st6m2j6vn3l2wdw83gj60m0000gp/T/pip-install-k9kqq3ux/pillow-jxl-plugin_d0d7e5cf120943aaaf3babcda3d40a5d)`

      Caused by:
        failed to load source for dependency `jpegxl-src`

      Caused by:
        Unable to update /private/var/folders/w8/m4st6m2j6vn3l2wdw83gj60m0000gp/T/pip-install-k9kqq3ux/pillow-jxl-plugin_d0d7e5cf120943aaaf3babcda3d40a5d/jpegxl-rs/jpegxl-src

      Caused by:
        failed to read `/private/var/folders/w8/m4st6m2j6vn3l2wdw83gj60m0000gp/T/pip-install-k9kqq3ux/pillow-jxl-plugin_d0d7e5cf120943aaaf3babcda3d40a5d/jpegxl-rs/jpegxl-src/Cargo.toml`

      Caused by:
        No such file or directory (os error 2)
      💥 maturin failed
        Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
        Caused by: `cargo metadata` exited with an error:
      Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/private/var/folders/w8/m4st6m2j6vn3l2wdw83gj60m0000gp/T/pip-modern-metadata-dt91j0oq', '--interpreter', '/Users/Tom/anaconda3/bin/python']' returned non-zero exit status 1.
      Checking for Rust toolchain....
      Running `maturin pep517 write-dist-info --metadata-directory /private/var/folders/w8/m4st6m2j6vn3l2wdw83gj60m0000gp/T/pip-modern-metadata-dt91j0oq --interpreter /Users/Tom/anaconda3/bin/python`
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

@dgutman I think this is the cause of the error we both are seeing.

Isotr0py commented 1 month ago

Which platform and python version do you use? It seems that pip doesn't find a matched prebuilt wheel for your python. Installation through pip is expected to install the pre-built wheels instead of the source code.

Building from source through pip may not work for current version, because we use a modified jpegxl-rs fork branch to support exif encoding temporarily.

This will be duplicated once they release the new version on the main branch which added exif support.

pearcetm commented 1 month ago

MacOS Ventura 13.3, Apple M1 Max chip. Cpython 3.10.14.

Strangely, I was getting the same error back in early May, but the next day I was able to install this package again with pip install(issue here: https://github.com/girder/large_image/issues/1475).

Isotr0py commented 1 month ago

Emmm, this may cause by our update setup-python@v4 to setup-python@v5. It seems that setup-python@v5 in release CI doesn't setup Cpython3.10 on macos by default, and it only set up python3.11 and python3.12...

I will fix this later.

Isotr0py commented 4 weeks ago

Sorry for the delay, the new macos aarch64 wheel for python3.10 has been uploaded to PYPI.

Can you check if it works now?

pearcetm commented 4 weeks ago

Thanks for fixing this! It is working for me now.