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

zlib not found on Synology #4525

Closed
alirz1 opened this issue Apr 3, 2020 · 7 comments
Closed

zlib not found on Synology #4525

alirz1 opened this issue Apr 3, 2020 · 7 comments
Labels
Installation Usually a problem with …

Comments

@alirz1
Copy link

alirz1 commented Apr 3, 2020

Installing FLEXGET on a synology NAS using Python 3.6.
Pillow seems to be one of the packages Python tries to install. No matter what I try, which version of python or pip etc i try, Pillow install always fails with the below error.

Running setup.py install for immutables ... done
Running setup.py install for contextvars ... done
Running setup.py install for itsdangerous ... done
Running setup.py install for markupsafe ... done
Running setup.py install for flask-compress ... done
Running setup.py install for zxcvbn-python ... done
Running setup.py install for aniso8601 ... done
Running setup.py install for tzlocal ... done
Running setup.py install for pyrss2gen ... done
Running setup.py install for rebulk ... done
Running setup.py install for babelfish ... done
Running setup.py install for guessit ... done
Running setup.py install for sqlalchemy ... done
Running setup.py install for progressbar ... done
Running setup.py install for rpyc ... done
Running setup.py install for pillow ... error
ERROR: Command errored out with exit status 1:
 command: /opt/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qu4hu_jm/pillow/setup.py'"'"'; __file__='"'"'/tmp/pi                                                                                                     p-install-qu4hu_jm/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(c                                                                                                     ompile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-p7z2vm3u/install-record.txt --single-version-externally-managed --compile --install-he                                                                                                     aders /opt/include/python3.6/pillow
     cwd: /tmp/pip-install-qu4hu_jm/pillow/
Complete output (166 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/PIL
copying src/PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageFont.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/__main__.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/Image.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/_binary.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PyAccess.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageSequence.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageTransform.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImagePalette.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/GdImageFile.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/_util.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/CurImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/TiffTags.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/FliImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageEnhance.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageShow.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageOps.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageTk.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PcfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/WalImageFile.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageMorph.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/_tkinter_finder.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageWin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/GimpGradientFile.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageDraw.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/features.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/JpegPresets.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/__init__.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImagePath.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageDraw2.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PSDraw.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageChops.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageCms.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ExifTags.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PdfParser.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/FontFile.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageMath.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageQt.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/GifImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/_version.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/MicImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/MspImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ContainerIO.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageColor.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageStat.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/BdfFontFile.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/TarIO.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageFile.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/SunImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/PngImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/ImageMode.py -> build/lib.linux-x86_64-3.6/PIL
copying src/PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-3.6/PIL
running egg_info
writing src/Pillow.egg-info/PKG-INFO
writing dependency_links to src/Pillow.egg-info/dependency_links.txt
writing top-level names to src/Pillow.egg-info/top_level.txt
reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.c'
warning: no files found matching '*.h'
warning: no files found matching '*.sh'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.codecov.yml'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'azure-pipelines.yml'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
no previously-included directories found matching '.azure-pipelines'
no previously-included directories found matching '.travis'
writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
warning: build_py: byte-compiling is disabled, skipping.

running build_ext


The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):
  File "/tmp/pip-install-qu4hu_jm/pillow/setup.py", line 892, in <module>
    zip_safe=not (debug_build() or PLATFORM_MINGW),
  File "/opt/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "/core.py", line 148, in setup
  File "/dist.py", line 955, in run_commands
  File "/dist.py", line 974, in run_command
  File "/opt/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
    return orig.install.run(self)
  File "/install.py", line 545, in run
  File "/cmd.py", line 313, in run_command
  File "/dist.py", line 974, in run_command
  File "/build.py", line 135, in run
  File "/cmd.py", line 313, in run_command
  File "/dist.py", line 974, in run_command
  File "/build_ext.py", line 339, in run
  File "/tmp/pip-install-qu4hu_jm/pillow/setup.py", line 687, in build_extensions
    raise RequiredDependencyException(f)
__main__.RequiredDependencyException: zlib

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-qu4hu_jm/pillow/setup.py", line 907, in <module>
    raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:

The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html

ERROR: Command errored out with exit status 1: /opt/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qu4hu_jm/pillow/set up.py'"'"'; file='"'"'/tmp/pip-install-qu4hu_jm/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'" ', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-p7z2vm3u/install-record.txt --single-version-external ly-managed --compile --install-headers /opt/include/python3.6/pillow Check the logs for full command output.

@alirz1 alirz1 changed the title Pillow install fail at arr Pillow install fail with error "The headers or library files could not be found for zlib" Apr 3, 2020
@radarhere
Copy link
Member

Googling, I think that the Synology DSM is closest to Debian, so you may want to run sudo apt-get install zlib1g-dev.

@radarhere radarhere added the Installation Usually a problem with … label Apr 4, 2020
@alirz1
Copy link
Author

alirz1 commented Apr 4, 2020

Googling, I think that the Synology DSM is closest to Debian, so you may want to run sudo apt-get install zlib1g-dev.

Thanks, but "apt" is not available in Synology OS.

@nulano
Copy link
Contributor

nulano commented Apr 4, 2020

Synology DSM does not ship with a package manager (except for the web interface, used to install preconfigured services). It looks like you already have optware, which installs the package manager ipkg. The correct command should be ipkg install zlib, or ipkg install zlib-dev depending on your system.

My understanding is that the pre-built wheels are not used due to the system cpu (check cat /proc/cpuinfo or Synology website). My system has an ARM cpu, perhaps the following project might be an alternative (claims to support Pillow, but I have no idea if it will work for Synology): https://github.com/imrehg/arm-wheels

@alirz1
Copy link
Author

alirz1 commented Apr 5, 2020

The problem I have is not related to Synology. I have seen several issues on the internet with the same error related to python and this package. I have another synology unit running an older version of python and Flexget.
I am just trying to get to a new release of flexget which required python 3.5 or newer. While I have installed python 3.6, flexget install fails at installing the "pillow" package which seems to depend on "zlib", Hence my issue detailed above

@radarhere
Copy link
Member

I'm not following your line of thinking.

zlib is a requirement of Pillow - https://pillow.readthedocs.io/en/stable/installation.html. It needs to be installed prior to using Pillow. If you're seeing "The headers or library files could not be found for zlib" problems on the Internet, it is most likely because those people need to install the zlib dependency, just like you do. If you think that there are genuine problems out there, feel free to link to those, so that we can be aware of the situation. I wouldn't say that having a dependency is a bug.

As for instructions on how to install zlib though, since you're not using one of the more popular operating systems, you need instructions specific to your operating system, Synology.

@jokester
Copy link

I heard Synology is based on some heavy-modified debian. In case it's hard to collect dependencies, running in a docker container might be a way to go.

@radarhere radarhere changed the title Pillow install fail with error "The headers or library files could not be found for zlib" zlib not found on Synology Aug 6, 2020
@radarhere
Copy link
Member

https://superuser.com/questions/991036/python-pillow-install-fails-despite-required-library-being-available agrees that ipkg is a solution here.

Given that a solution has been posted earlier, and the discussion has not continued, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Installation Usually a problem with …
Projects
None yet
Development

No branches or pull requests

4 participants