Repository navigation
Description
Hello,
Attempting to install the current version of Pillow (9.1.0) fails with Python-3.9.10 under Cygwin64. I attempted installing both via pip3 and via python3 setup.py build. Both fail the same way.
Installation succeeds until the configuration stops with a message that the required headers and/or library files for jpeg were not found.
Jpeg packages (both jpeg and openjpeg) are installed including the developer packages. Both header files and library files are in fact present in the right directories.
I had a hunch that this might be a library file naming issue. In /usr/lib the following jpeg-related files are present:
/usr/lib/libjpeg.dll.a
/usr/lib/libopenjpeg.dll.a
To test, I built and installed a static libjpeg.a and put libjpeg.a file in /usr/local/lib. That done, the build succeeded to the point that the extension was built. However, most other supporting libraries were not detected despite that most of them were in fact installed (including developer packages); the corresponding packages all exclusively install shared libraries (dll's), not static:
The output from the build produced:
--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version Pillow 9.1.0
platform cygwin 3.9.10 (main, Jan 20 2022, 21:37:52)
[GCC 11.2.0]
--------------------------------------------------------------------
--- JPEG support available
*** OPENJPEG (JPEG2000) support not available
--- ZLIB (PNG/ZIP) support available
*** LIBIMAGEQUANT support not available
*** LIBTIFF support not available
*** FREETYPE2 support not available
*** RAQM (Text shaping) support not available
*** LITTLECMS2 support not available
*** WEBP support not available
*** WEBPMUX support not available
*** XCB (X protocol) support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library and headers.
There is in fact a zlib static library in /usr/lib and, thus, presence of zlib was detected.
So either:
- the build currently only works with static libraries, or
- there is a an issue with properly detecting the shared libraries.
Under Cygwin the dll files are located in /usr/bin with names such as cygtiff-6.dll, cygjpeg-8.dll, cygopenjpeg-1.dll, cygimagequant-0.dll etc. The link files have names such as libjpeg.dll.a etc.
- OS: Cygwin64 under Windows 10 (64 bit) updated
- Python: 3.9.10 (Cygwin64 version updated)
- Pillow: 9.1.0
Activity
[-]Installation of Pillow fails under Cygwin64 due jpeg not being detected[/-][+]JPEG not detected when installing Pillow under Cygwin64[/+]radarhere commentedon Apr 23, 2022
@DWesl do you have any thoughts on this one?
DWesl commentedon Apr 23, 2022
I know the Pillow tests require jpeg command-line utilities in addition to the jpeg and jpeg-2000 libraries. From #5878, the relevant Cygwin packages seem to be
jpeg libjpeg-devel libopenjp2-devel. I have not had problems with linking to dynamic libraries (with the.dll.aimport libraries) rather than static libraries.If installing the packages mentioned before doesn't fix the issue, it would help to have a list of installed Cygwin packages, with
cygcheck -c, or perhaps even the full (perhaps filtered to replace${USER}, ${HOSTNAME}, ${COMPUTERNAME}, ${TZ}and similar) output ofcygcheck -svr, that I could check.biogberg commentedon Apr 24, 2022
Thank you for your responses!
The list of installed packages is attached.
cygwin_pkgs.txt.gz
DWesl commentedon Apr 28, 2022
You may want
libopenjp2-devel, which seems kinda relevant from my list of installed packages.python39-sipis probably irrelevant for this, but is on my list of packages.Are you installing using
setup-x86_64.exe?biogberg commentedon Apr 29, 2022
Yes, everything is installed using
setup-x86_64.exe.Installing python39-sip and libopenjp2-devel did not change anything the output is still:
And: as mentioned above, adding a static libjpeg. a to /usr/local allows installation to (sort of) work.
DWesl commentedon Apr 29, 2022
Well that's weird. What's your
PATHlike? Doesenv PATH=/usr/bin:/bin /usr/bin/python3.9 setup.py build_extget farther?DWesl commentedon Apr 30, 2022
I can reproduce this on 32-bit Cygwin. This wasn't an issue a few months ago, so you should be able to get pillow from a version or three back. I haven't figured out where things are breaking yet.
DWesl commentedon May 1, 2022
Try installing
setuptools<60, then runningpython setup.py build_extbiogberg commentedon May 2, 2022
BINGO!
Replacing pip3-installed setuptools 62.1.0 with pip3-installed 59.8.0 (the final pre-60 release) allows
python setup.py build_extto complete.The setup summary now becomes:
Installation of Pillow worked under Cygwin64 worked some time ago. For Python 3.8, I have a dist-info directory with files with modification date Oct 24, 2021.
DWesl commentedon May 2, 2022
Cygwin setuptools is still at version 59.5.0, so install should work on a new Cygwin64 installation. Cygwin isn't likely to upgrade until NumPy and setuptools>60 regain compatibility
Do you want to report this to setuptools, or should I?
biogberg commentedon May 2, 2022
It will probably have a greater impact if you do...
radarhere commentedon May 2, 2022
Thanks very much for figuring this one out.
Closing. pypa/setuptools#3302 can now be followed instead.
CI: Pin Cygwin setuptools<60 and avoid problem upgrades
DWesl commentedon May 10, 2022
pypa/distutils#139 has merged a fix into upstream of setuptools, so that fix should be propagating into setuptools in time.
For anyone who needs a fix before then and cannot downgrade to
setuptools<60, setting an environment variableSETUPTOOLS_USE_DISTUTILS=stdlibshould allow the patches in the Cygwin python packages to handle this case, and I think that environment variable will stick around until setuptools upgrades its bundled distutils.biogberg commentedon May 10, 2022
Thank you for helping with this!
CI: Add a Cygwin run to GHA CI.
CI: Add a Cygwin run to GHA CI.