olokelo / jxlpy

Cython bindings and Pillow plugin for JPEG XL
MIT License
45 stars 12 forks source link

Can't install via pip on windows #10

Open JMans15 opened 2 years ago

JMans15 commented 2 years ago

Hi, I tried to install jxlpy on windows using pip install jxlpy and got this error: ValueError: '_jxlpy/_jxl.pyx' doesn't match any files

C0rn3j commented 1 year ago

This is not a Windows exclusive issue, the Github 0.9.1 release is correct, the 0.9.1 release on PyPi is broken.

So is 0.9.2, but that does not have a Github release to compare to.

python setup.py build
python setup.py install --root="$pkgdir"
Traceback (most recent call last):
  File "/home/c0rn3j/AUR/python-jxlpy/src/jxlpy-0.9.2/setup.py", line 37, in <module>
    ext_modules=cythonize([jxlpy_ext]),
  File "/home/c0rn3j/.local/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 970, in cythonize
    module_list, module_metadata = create_extension_list(
  File "/home/c0rn3j/.local/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 816, in create_extension_list
    for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
  File "/home/c0rn3j/.local/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 114, in nonempty
    raise ValueError(error_msg)
ValueError: '_jxlpy/_jxl.pyx' doesn't match any files

PKGBUILD (for pacman) that I tested on

pkgname=python-jxlpy
_reponame=jxlpy
pkgver=0.9.2
pkgrel=1
pkgdesc="Module for reading and writing support for JPEG XL directly from Python"
url="https://pypi.org/project/jxlpy/"
arch=(any)
license=('GPL3')
depends=('python' 'libjxl')
makedepends=('python-setuptools' 'cython' 'git')
source=("https://pypi.org/packages/source/${_reponame::1}/${_reponame}/${_reponame}-$pkgver.tar.gz")
#source=("$pkgname-$pkgver.tar.gz::https://github.com/olokelo/jxlpy/archive/${pkgver}.tar.gz")
sha256sums=('26b5c6a85c492392008b0f80763cd90ba48540ade98b1e837ce800a551b2b844')

build() {
    cd "$srcdir/${_reponame}-$pkgver"
    python setup.py build
}

package() {
    cd "$srcdir/${_reponame}-$pkgver"
    python setup.py install --root="$pkgdir"
}
inversepixel commented 1 year ago

I have the same problem on Windows. Any estimation on when this will be fixed or any workarounds? Many thanks! /Tomas

alexjc commented 1 year ago

It shows the same problem on MacOS as it's building from source. I the binaries work, but not the source ones?

zhou13 commented 1 year ago

It seems that

pip install git+https://github.com/olokelo/jxlpy

works for me

C0rn3j commented 5 months ago

The freshly released 0.9.3 github version is now correctly packaged.

PyPi seems to ship the _jxl.cpp still instead of _jxl.pyx, but pip install jxlpy now runs fine in a Linux venv on 3.11.6.

So I suppose this can be closed if Windows users can also confirm.

c4yg70 commented 4 months ago

The freshly released 0.9.3 github version is now correctly packaged.

PyPi seems to ship the _jxl.cpp still instead of _jxl.pyx, but pip install jxlpy now runs fine in a Linux venv on 3.11.6.

So I suppose this can be closed if Windows users can also confirm.

Tested and works great in all below settings:

Could not work even build loaclly:

olokelo commented 4 months ago

Hi, thanks for testing on all those platforms.

If you have time you could also try building from master branch source modifying setup.py like here. For some reason .pyx file wasn't included in latest sdist on PyPI but maybe that 'hack' will make future releases build without issues.

Also I'm glad you had success building it on Windows.

c4yg70 commented 4 months ago

I use PDM for my package manager so maybe thanks to pdm solved that problem for me? I tried again yesterday and here is the result: directly calling pypi from python-windows installing ver0.9.3 would refuse to work, but calling from docker or using pdm worked fine. However, I do have libjxl compiled externally on my system, so others may fail to install. I would like to try building from source lately this week.

Also, libjxl has updated and wish to see a minor version update for jxlpy.

Best wishes.

olokelo commented 4 months ago

jxlpy 0.9.4 now ships with libjxl 0.10.1 and possibly fixed source distribution. You can try it :)