wanadev / mozjpeg-lossless-optimization

Python library to optimize JPEGs losslessly using MozJPEG
Other
34 stars 2 forks source link

Release the wheels for Python 3.12 #6

Closed oevesque closed 11 months ago

oevesque commented 11 months ago

Can I install it with pip on python 3.12 ? I've got the error:

C:\Users\XXX\Downloads\mozjpeg-lossless-optimization>pip install mozjpeg-lossless-optimization
Collecting mozjpeg-lossless-optimization
  Using cached mozjpeg-lossless-optimization-1.1.2.tar.gz (1.0 MB)
  Preparing metadata (setup.py) ... done
Collecting cffi>=1.0.0 (from mozjpeg-lossless-optimization)
  Obtaining dependency information for cffi>=1.0.0 from https://files.pythonhosted.org/packages/e9/63/e285470a4880a4f36edabe4810057bd4b562c6ddcc165eacf9c3c7210b40/cffi-1.16.0-cp312-cp312-win_amd64.whl.metadata
  Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl.metadata (1.5 kB)
Collecting pycparser (from cffi>=1.0.0->mozjpeg-lossless-optimization)
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl (181 kB)
Building wheels for collected packages: mozjpeg-lossless-optimization
  Building wheel for mozjpeg-lossless-optimization (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      C:\Users\XXX\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!

              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************

      !!
        dist.fetch_build_eggs(dist.setup_requires)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-312
      creating build\lib.win-amd64-cpython-312\mozjpeg_lossless_optimization
      copying mozjpeg_lossless_optimization\mozjpeg_opti.py -> build\lib.win-amd64-cpython-312\mozjpeg_lossless_optimization
      copying mozjpeg_lossless_optimization\mozjpeg_opti_build.py -> build\lib.win-amd64-cpython-312\mozjpeg_lossless_optimization
      copying mozjpeg_lossless_optimization\__init__.py -> build\lib.win-amd64-cpython-312\mozjpeg_lossless_optimization
      running build_ext
      generating cffi module 'build\\temp.win-amd64-cpython-312\\Release\\mozjpeg_lossless_optimization._mozjpeg_opti.c'
      creating build\temp.win-amd64-cpython-312
      creating build\temp.win-amd64-cpython-312\Release
      error: [WinError 2] Le fichier spécifié est introuvable
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mozjpeg-lossless-optimization
  Running setup.py clean for mozjpeg-lossless-optimization
Failed to build mozjpeg-lossless-optimization
ERROR: Could not build wheels for mozjpeg-lossless-optimization, which is required to install pyproject.toml-based projects"

I've try multiple update, but I stil can't install it. It's a fresh python 3.12 installation on a new computer.

flozz commented 11 months ago

It worked for me with Python 3.12 on Windows 10:

image

But as I do not released the wheels for Python 3.12 yet, you have to install Visual Studio with everything needed to compile C code...

oevesque commented 11 months ago

I'm on Windows 11. But as I don't know what wheels is and I have no idea how to compile C stuff, I will downgrade to python 3.11

flozz commented 11 months ago

Currently there is two types of packages for Python:

For MozJPEG Lossless Optimization, you can see all of them here: https://pypi.org/project/mozjpeg-lossless-optimization/#files

when you run pip install mozjpeg-lossless-optimization, pip will first search for a wheel compatible with your system (OS/Py version/Architecture). If it cannot find one, it will use the sdist package instead.


Anyway don't worry I am working to publish wheels for Python 3.12 right now :)

flozz commented 11 months ago

The build of the wheels is in progress:

https://github.com/wanadev/mozjpeg-lossless-optimization/actions/runs/6421363634

Packages should be automatically published if everything goes fine... :)

oevesque commented 11 months ago

merci beaucoup, ca fonctionne déjà 👍

flozz commented 11 months ago

Packages have been published successfully :)