inky icon indicating copy to clipboard operation
inky copied to clipboard

Issues installing on Pi Zero 2W

Open MelleNi opened this issue 8 months ago • 11 comments

Using latest Raspberry Pi OS Lite 32bit

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

When installing the examples: Building lxml version 5.4.0. Building without Cython. Error: Please make sure the libxml2 and libxslt development packages are installed.

Before installing I did sudo apt install python3-numpy and sudo apt install libopenblas-dev

Is there anything I'm missing?

MelleNi avatar May 05 '25 10:05 MelleNi

Tried this too: https://github.com/pimoroni/inky/issues/219#issuecomment-2839883574

sudo apt update && sudo apt upgrade -y
sudo apt install git
git clone https://github.com/pimoroni/inky.git
cd inky/
./install.sh
source ~/.virtualenvs/pimoroni/bin/activate
pip install --only-binary=:all: inky
sudo apt-get install libopenjp2-7
sudo apt install libopenblas-dev

but doesn't work either:

Collecting numpy
  Downloading numpy-2.2.5.tar.gz (20.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 20.3/20.3 MB 1.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      + /home/melle/.virtualenvs/pimoroni/bin/python /tmp/pip-install-wreomye2/numpy_fbd00f35ae034fff9fa160f7202290f5/vendored-meson/meson/meson.py setup /tmp/pip-install-wreomye2/numpy_fbd00f35ae034fff9fa160f7202290f5 /tmp/pip-install-wreomye2/numpy_fbd00f35ae034fff9fa160f7202290f5/.mesonpy-lroel0tl -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-wreomye2/numpy_fbd00f35ae034fff9fa160f7202290f5/.mesonpy-lroel0tl/meson-python-native-file.ini
      The Meson build system
      Version: 1.5.2
      Source dir: /tmp/pip-install-wreomye2/numpy_fbd00f35ae034fff9fa160f7202290f5
      Build dir: /tmp/pip-install-wreomye2/numpy_fbd00f35ae034fff9fa160f7202290f5/.mesonpy-lroel0tl
      Build type: native build
      Project name: NumPy
      Project version: 2.2.5
      C compiler for the host machine: cc (gcc 12.2.0 "cc (Raspbian 12.2.0-14+rpi1) 12.2.0")
      C linker for the host machine: cc ld.bfd 2.40
      C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Raspbian 12.2.0-14+rpi1) 12.2.0")
      C++ linker for the host machine: c++ ld.bfd 2.40
      Cython compiler for the host machine: cython (cython 3.0.12)
      Host machine cpu family: arm
      Host machine cpu: armv7l
      Program python found: YES (/home/melle/.virtualenvs/pimoroni/bin/python)
      Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
      Run-time dependency python found: NO (tried pkgconfig, pkgconfig and sysconfig)
      
      ../meson.build:41:12: ERROR: Python dependency not found
      
      A full log can be found at /tmp/pip-install-wreomye2/numpy_fbd00f35ae034fff9fa160f7202290f5/.mesonpy-lroel0tl/meson-logs/meson-log.txt
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

MelleNi avatar May 05 '25 13:05 MelleNi

I'm having the same issue with my new inky impression 7.3 :( did you find a solution?

michaelsage avatar May 21 '25 18:05 michaelsage

I modified the previously mentioned solution that didn't work to:

sudo apt update && sudo apt upgrade -y
sudo apt install git
sudo apt-get install libopenjp2-7
sudo apt install libopenblas-dev
sudo apt install python3-numpy
git clone https://github.com/pimoroni/inky.git
cd inky/
./install.sh
source ~/.virtualenvs/pimoroni/bin/activate
pip install --only-binary=:all: inky

Just copy paste that and when done enable i2c and SPI with sudo raspi-config.

If you do it in that order it should work.

MelleNi avatar May 21 '25 18:05 MelleNi

I just installed it yesterday according to Fatihak's Git and everything worked super easy. Maybe give it a try

Cironic avatar May 31 '25 09:05 Cironic

Did some digging into why this is happening, since we usually rely on PiWheels to provide binary wheels (and avoid compilation) for dependencies.

PiWheels is currently undergoing maintenance with builds suspended, so numpy 2.2.5 has no binary wheel available: https://www.piwheels.org/project/numpy/

Looks like Fatihak has worked round this by pinning a dependency at 2.2.1.

I'll add a requirements.txt to fixup our installer so that it works the same way.

Thanks for your patience and sleuthing here, and sorry for the delay to respond!

Gadgetoid avatar Jun 02 '25 11:06 Gadgetoid

I had the exact same error with my brand new Raspberry Pi Zero 2 W:

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

Somehow I progressed to a different error, specifically during install example dependencies:

Would you like to install example dependencies? [y/N] y
Installing dependencies from requirements-examples.txt...

(after a short time (successfully) installing beautifulsoup4, wikiquotes, etc...)

Collecting pandas>=1.2
  Using cached pandas-2.3.0.tar.gz (4.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

... the install process failed on pandas. The Preparing metadata (pyproject.toml) ... step took well over 10 minutes before that above error. The next time I tried, it timed out after about an hour:

  Preparing metadata (pyproject.toml) ... |Read from remote host 192.168.1.117: Operation timed out

Fix

I eventually got the Inky library working on my Pi by running:

sudo apt-get install python3-pandas

From there I just ran the install steps again:

cd inky
./install.sh

That skipped over pandas, recognising it as already installed. Then I just enabled the virtual environment:

source ~/.virtualenvs/pimoroni/bin/activate

...and successfully rendered the examples on the Inky Impression (4"). Phew, not easy.

dnywh avatar Jun 12 '25 05:06 dnywh

Not sure if I am having the same issue as above, but :~/inky $ ./install.sh has been running all day!

Would you like to install example dependencies? [y/N] y
Installing dependencies from requirements-examples.txt...
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pillow in /usr/lib/python3/dist-packages (from -r requirements-examples.txt (line 1)) (9.4.0)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from -r requirements-examples.txt (line 2)) (2.28.1)
Requirement already satisfied: beautifulsoup4 in /usr/lib/python3/dist-packages (from -r requirements-examples.txt (line 3)) (4.11.2)
Collecting fonts
  Using cached https://www.piwheels.org/simple/fonts/fonts-0.0.3-py3-none-any.whl (4.2 kB)
Collecting font-source-sans-pro
  Using cached https://www.piwheels.org/simple/font-source-sans-pro/font_source_sans_pro-0.0.1-py3-none-any.whl (2.2 MB)
Collecting font-source-serif-pro
  Using cached https://www.piwheels.org/simple/font-source-serif-pro/font_source_serif_pro-0.0.1-py3-none-any.whl (1.8 MB)
Collecting font-fredoka-one
  Using cached https://www.piwheels.org/simple/font-fredoka-one/font_fredoka_one-0.0.4-py3-none-any.whl (27 kB)
Collecting font-hanken-grotesk
  Using cached https://www.piwheels.org/simple/font-hanken-grotesk/font_hanken_grotesk-0.0.2-py3-none-any.whl (391 kB)
Collecting font-intuitive
  Using cached https://www.piwheels.org/simple/font-intuitive/font_intuitive-0.0.4-py3-none-any.whl (36 kB)
Collecting geocoder
  Using cached https://www.piwheels.org/simple/geocoder/geocoder-1.38.1-py2.py3-none-any.whl (98 kB)
Collecting seaborn
  Using cached https://www.piwheels.org/simple/seaborn/seaborn-0.13.2-py3-none-any.whl (294 kB)
Collecting wikiquotes
  Using cached https://www.piwheels.org/simple/wikiquotes/wikiquotes-1.4-py3-none-any.whl (20 kB)
Requirement already satisfied: click in /usr/lib/python3/dist-packages (from geocoder->-r requirements-examples.txt (line 10)) (8.1.3)
Collecting future
  Using cached https://www.piwheels.org/simple/future/future-1.0.0-py3-none-any.whl (491 kB)
Collecting ratelim
  Using cached https://www.piwheels.org/simple/ratelim/ratelim-0.1.6-py2.py3-none-any.whl (4.0 kB)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from geocoder->-r requirements-examples.txt (line 10)) (1.16.0)
Requirement already satisfied: numpy!=1.24.0,>=1.20 in /usr/lib/python3/dist-packages (from seaborn->-r requirements-examples.txt (line 11)) (1.24.2)
Collecting pandas>=1.2
  Using cached pandas-2.3.0.tar.gz (4.5 MB)
  Installing build dependencies ... \

and its been sitting there for quite some hours now... is this expected? is there a way to speed this up by preinstalling something?

r-colvin avatar Jul 03 '25 13:07 r-colvin

and its been sitting there for quite some hours now... is this expected? is there a way to speed this up by preinstalling something?

I suspect this is hung trying to get login credentials for apt. It may be that PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring helps.

Installing pandas up-front should work:

source ~/.virtualenvs/pimoroni/bin/activate
pip install pandas=2.2.3

Again there's no binary wheel for pandas 2.3.0 in piwheels https://www.piwheels.org/project/pandas/ so I should pin the older version until the PiWheels maintenance is complete - https://github.com/piwheels/packages/issues/530

(Actually I should pin all versions always 🤦 )

Gadgetoid avatar Jul 03 '25 13:07 Gadgetoid

@Gadgetoid cheers - did a

sudo apt-get install python3-pandas

and that seems to have fixed it - would your solution be better?

r-colvin avatar Jul 03 '25 13:07 r-colvin

would your solution be better?

It's a temporary fix, but with any luck it's a temporary problem. I've merged it into our main branch along with the other fixes.

Gadgetoid avatar Jul 03 '25 15:07 Gadgetoid

I was having this same issue. Was able to resolve it with:

sudo apt update && sudo apt upgrade -y
sudo apt-get install git python3-pandas python3-numpy
git clone https://github.com/pimoroni/inky.git
cd inky/
./install.sh
sudo reboot

Then after rebooting:

Manually enabling I2C and SPI in sudo raspi-config (under Interface Options).

source ~/.virtualenvs/pimoroni/bin/activate

From here the examples would then detect the Inky and run.

seanhealy avatar Oct 11 '25 20:10 seanhealy