error when installing library
Closed this issue · 6 comments
Hello,
Unfortunately, I get an error when trying to install the luma.led_matrix library. I followed the instructions given here:
https://luma-led-matrix.readthedocs.io/en/latest/install.html
(a) SPI is enabled:
osmc@osmc:~$ lsmod | grep -i spi
spi_bcm2835 7817 0
osmc@osmc:~$ ls -l /dev/spi*
crw-rw---- 1 root osmc 153, 0 Sep 17 15:19 /dev/spidev0.0
crw-rw---- 1 root osmc 153, 1 Sep 17 15:19 /dev/spidev0.1
(b) Dependencies are installed:
$ sudo usermod -a -G spi,gpio pi
$ sudo apt-get install python-dev python-pip libfreetype6-dev libjpeg-dev
$ sudo -i pip install --upgrade pip setuptools
$ sudo apt-get purge python-pip
osmc@osmc:~$ pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
(c) Installing latest version of the library fails:
osmc@osmc:/tmp$ sudo -H pip install --upgrade luma.led_matrix
Collecting luma.led_matrix
Using cached luma.led_matrix-1.0.2-py2-none-any.whl
Collecting luma.core>=1.0.0 (from luma.led_matrix)
Using cached luma.core-1.0.2-py2.py3-none-any.whl
Requirement already up-to-date: monotonic; python_version < "3.3" in /usr/local/lib/python2.7/dist-packages (from luma.core>=1.0.0->luma.led_matrix)
Collecting RPI.GPIO; platform_system == "Linux" (from luma.core>=1.0.0->luma.led_matrix)
Using cached RPi.GPIO-0.6.3.tar.gz
Collecting smbus2 (from luma.core>=1.0.0->luma.led_matrix)
Using cached smbus2-0.2.0.tar.gz
Collecting pillow>=4.0.0 (from luma.core>=1.0.0->luma.led_matrix)
Using cached Pillow-4.2.1.tar.gz
Collecting spidev; platform_system == "Linux" (from luma.core>=1.0.0->luma.led_matrix)
Using cached spidev-3.2.tar.gz
Collecting olefile (from pillow>=4.0.0->luma.core>=1.0.0->luma.led_matrix)
Using cached olefile-0.44.zip
Installing collected packages: RPI.GPIO, smbus2, olefile, pillow, spidev, luma.core, luma.led-matrix
Running setup.py install for RPI.GPIO ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-LfO2YY/RPI.GPIO/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-7dBjQN-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/RPi
copying RPi/__init__.py -> build/lib.linux-armv7l-2.7/RPi
creating build/lib.linux-armv7l-2.7/RPi/GPIO
copying RPi/GPIO/__init__.py -> build/lib.linux-armv7l-2.7/RPi/GPIO
running build_ext
building 'RPi._GPIO' extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/source
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv7l-2.7/source/py_gpio.o
unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-LfO2YY/RPI.GPIO/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-7dBjQN-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-LfO2YY/RPI.GPIO/
Any ideas?
Thanks.
Supplement:
RPi Model:
RPi2B
Kernel version:
osmc@osmc:~$ uname -a
Linux osmc 4.9.29-9-osmc #1 SMP PREEMPT Sat Jul 29 01:44:42 UTC 2017 armv7l GNU/Linux
So the actual error is unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
-
basically there is no C compiler installed on your RPi. This sounds like python-dev was not installed correctly (it should ensure that all the compiler dependencies were installed). What is the output of:
$ apt show python-dev
And then can you retry this:
$ sudo apt-get install python-dev libfreetype6-dev libjpeg-dev
$ sudo -H pip install --upgrade luma.led_matrix
Thank you rm-hull for the quick reply. From what I can see, python-dev seems to be installed correctly:
osmc@osmc:~$ apt show python-dev
Package: python-dev
Source: python-defaults
Version: 2.7.9-1
Installed-Size: 46,1 kB
Maintainer: Matthias Klose <doko@debian.org>
Depends: python (= 2.7.9-1), libpython-dev (= 2.7.9-1), python2.7-dev (>= 2.7.9-1~)
Homepage: http://www.python.org/
Tag: devel::lang:python, devel::library, implemented-in::python,
role::devel-lib
Section: python
Priority: optional
Download-Size: 1.180 B
APT-Manual-Installed: yes
APT-Sources: http://ftp.debian.org/debian/ jessie/main armhf Packages
Description: Header-Dateien und eine statische Bibliothek für Python (Standard)
Header-Dateien, eine statische Bibliothek und Entwicklungswerkzeuge zum
Erstellen von Python-Modulen, Erweitern des Python-Interpreters oder
Einbetten von Python in Anwendungen.
.
Dieses Paket enthält lediglich eine Abhängigkeit zu Debians Standard-Python-
Version (derzeit 2.7).
Sorry for using a german OS. Let me know if something is unclear. After that, when retrying:
$ sudo apt-get install python-dev libfreetype6-dev libjpeg-dev
$ sudo -H pip install --upgrade luma.led_matrix
the error unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
remains.
Any further ideas?
@3zra what about sudo apt-get install build-essential
?
@thijstriemstra installing build-essential
did the job. Now, the installation of the luma.led_matrix
libraries works. Thanks a lot.
Awesome. Now we'll have to fix the documentation across projects I think @rm-hull?
Yep... although I wonder if we should actually expend some effort in unifying the docs into https://github.com/rm-hull/luma.docs