Pillow error in Moonraker installation

Basic Information:

Printer Model: Custom CoreXY
MCU / Printerboard: Udoo Quad / Radds
Host / SBC
klippy.log >not installed

Hello Word!
I try to install klipper by kiauh, but I have a problem with Moonraker.
But, at first, my configuration: a single board Udoo Quad with Radds, Ubuntu 18.04, Python 3.8.0.; and those are my packages:

Package Version


certifi 2024.6.2
chardet 3.0.4
distlib 0.3.8
filelock 3.14.0
httplib2 0.9.2
idna 2.6
mate-tweak 18.4.16
netifaces 0.10.4
PAM 0.4.2
pip 24.0
pipenv 2023.12.1
platformdirs 4.2.2
psutil 5.4.2
PyGObject 3.26.1
pyserial 3.4
python-apt 1.6.6
PyYAML 3.12
requests 2.18.4
requests-unixsocket 0.1.5
setproctitle 1.1.10
setuptools 70.0.0
six 1.11.0
ubuntu-pro-client 8001
unattended-upgrades 0.1
urllib3 1.22
virtualenv 20.26.2
wheel 0.43.0

Ok, when I try to install Moonraker, system shows this error:

Using cached zipp-3.19.1-py3-none-any.whl (9.0 kB)
Building wheels for collected packages: pillow, streaming-form-data
  Building wheel for pillow (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  Ă— Building wheel for pillow (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [184 lines of output]

…then

arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_WEBPMUX -I/usr/include/openjpeg-2.3 -I/usr/include/arm-linux-gnueabihf -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/fribidi -I/usr/local/include -I/usr/include -I/home/udooer/moonraker-env/include -I/usr/include/python3.8 -c src/_webp.c -o build/temp.linux-armv7l-cpython-38/src/_webp.o
      src/_webp.c:2:10: fatal error: Python.h: No such file or directory
       #include <Python.h>
                ^~~~~~~~~~
      src/_imagingcms.c:30:10: fatal error: Python.h: No such file or directory
       #include "Python.h"  // Include before wchar.h so _GNU_SOURCE is set
                ^~~~~~~~~~
      compilation terminated.
      src/_imaging.c:75:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      src/_imagingft.c:22:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      compilation terminated.
      building 'PIL._imagingtk' extension
      creating build/temp.linux-armv7l-cpython-38/src/Tk
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/openjpeg-2.3 -I/usr/include/arm-linux-gnueabihf -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/fribidi -I/usr/local/include -I/usr/include -I/home/udooer/moonraker-env/include -I/usr/include/python3.8 -c src/Tk/tkImaging.c -o build/temp.linux-armv7l-cpython-38/src/Tk/tkImaging.o
      building 'PIL._imagingmath' extension
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/openjpeg-2.3 -I/usr/include/arm-linux-gnueabihf -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/fribidi -I/usr/local/include -I/usr/include -I/home/udooer/moonraker-env/include -I/usr/include/python3.8 -c src/_imagingmath.c -o build/temp.linux-armv7l-cpython-38/src/_imagingmath.o
      building 'PIL._imagingmorph' extension
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/openjpeg-2.3 -I/usr/include/arm-linux-gnueabihf -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/fribidi -I/usr/local/include -I/usr/include -I/home/udooer/moonraker-env/include -I/usr/include/python3.8 -c src/_imagingmorph.c -o build/temp.linux-armv7l-cpython-38/src/_imagingmorph.o
      src/_imagingmath.c:16:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      In file included from src/Tk/../libImaging/Imaging.h:13:0,
                       from src/Tk/tkImaging.c:42:
      src/Tk/../libImaging/ImPlatform.h:10:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      src/_imagingmorph.c:14:10: fatal error: Python.h: No such file or directory
       #include "Python.h"
                ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pillow
  Building wheel for streaming-form-data (setup.py) ... error
  error: subprocess-exited-with-error
  
  Ă— python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running bdist_wheel

…so, at the end…

compilation terminated.
      error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for streaming-form-data
  Running setup.py clean for streaming-form-data
Failed to build pillow streaming-form-data
ERROR: Could not build wheels for pillow, streaming-form-data, which is required to install pyproject.toml-based projects

I tried to install Pillow,with the same result, by running

python3.8 -m pip install --upgrade Pillow --no-binary :all:

Any suggest?
thanks and a nice day for all the comunity!

I found a solution! (it’s strange, you spent hours to solve a problem without success, but then you asked to the forum…bang!..you find solution by yourself)
Althought many passages are probabily uselesses, finally klipper, moonraker and mainsail are installed:

sudo apt update
sudo apt upgrade
sudo apt install python3.8
sudo apt install python3-venv
sudo apt install python3.8-venv
python3.8 -m venv env
sudo apt install python3-pip
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
pip3 install -U setuptools
sudo apt install python-dev
sudo apt install python3.8-dev
python3 -m pip install --user pipenv
python3 -m pip install wheel
sudo apt install mc

write into file “/etc/enviroment” this line: ~/.local/bin
Then install kiauh

cd ~
git clone GitHub - dw-0/kiauh: Klipper Installation And Update Helper
./kiauh/kiauh.sh

I hope this solution could help someone!

1 Like

Thanks for sharing.
I have to admit that it sounds a bit like a messed up (or at least special) Python installation.
For example when using the regular package managers in distributions it is rather uncommon to have two different Python 3.x version.
This of course can lead to strange issues when mixing them.

Udoo quad is a strange mobo…it is a single board, but it has an Arduino Due built-in, so you can link it with a RADDS. Unfortunately, there is only an old official version (ubuntu 14) and a “unofficial” Ubuntu 18.04 distribution with Python3.5.
Now klipper is installed, but Moonraker service have problems (sqlite3.OperationalError: near “ON”: syntax error), perhaps because of different version of library

The version of sqlite that ships with Ubuntu 18.04 is too old and doesn’t support some of the syntax used in Moonraker’s database component. You could try falling back to the commit before Moonraker migrated to sqlite, per this issue the hash is 9d0d09de8063922696359c1b88c86a86d6fdb296.

As an alternative, there is at least a community maintained Armbian support: Udoo quad - Armbian

If it is running properly, I cannot tell.

When I tried it, wireless didn’t work…but it was years ago

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.