Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DelayedImportError: could not import name 'jpegxl_encode' from 'imagecodecs' #29

Closed
JackKelly opened this issue Jan 28, 2022 · 2 comments
Labels
question Further information is requested

Comments

@JackKelly
Copy link

JackKelly commented Jan 28, 2022

Thanks so much for your work on this awesome library!

Sorry if I'm doing something wrong but I'm bumping into this exception with numcodecs 2021.11.20 (installed using conda today):

---------------------------------------------------------------------------
DelayedImportError                        Traceback (most recent call last)
Input In [29], in <module>
----> 1 encoded = jpegxl_encode(input_buffer, distance=0)

File ~/miniconda3/envs/jpegxl/lib/python3.10/site-packages/imagecodecs/imagecodecs.py:616, in _stub.<locals>.stub_encode(*args, **kwargs)
    614 def stub_encode(*args, **kwargs):
    615     """Stub for imagecodecs.codec_encode function."""
--> 616     raise DelayedImportError(name)

DelayedImportError: could not import name 'jpegxl_encode' from 'imagecodecs'

Steps to reproduce

conda install imagecodecs numpy

from imagecodecs import jpegxl_encode
import numpy as np

input_buffer = np.arange(1000000, dtype='uint8').reshape(1000, 1000)
encoded = jpegxl_encode(input_buffer, distance=0)

Context

I'm running this Python code in Jupyter Lab.

I installed libjxl v0.7.0 dev (compiling from HEAD, yesterday) before installing imagecodecs. cjxl appears to work correctly. I'm on Ubuntu 21.04.

I've also tried installing the libjxl 0.6.1 release now using the Ubuntu .deb file and re-installing imagecodecs but that didn't appear to help.

@cgohlke
Copy link
Owner

cgohlke commented Jan 28, 2022

libjxl is currently not available in conda-forge and the jpegxl codec extension is not included in their imagecodecs builds. Please open an issue at https://github.com/conda-forge/imagecodecs-feedstock.

The jpegxl codec is functional in the Windows and 64-bit Linux wheels. On MacOS and 32-bit Linux libjxl would not build.

@JackKelly
Copy link
Author

Thanks loads for the very quick reply! I'll try installing imagecodecs from pip! I have done as you suggested and submitted an issue: conda-forge/imagecodecs-feedstock#48

Thanks again for all your hard work on imagecodecs!

@cgohlke cgohlke added the question Further information is requested label Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants