jd-boyd/python-lzo

Installing on Raspberry Pi - lzo/lzo1x.h: No such file or directory

0kit0 opened this issue · 2 comments

0kit0 commented

Hi
I'm trying to install the python-lzo on a Raspberry Pi Zero W Running a fresh full installation of Raspbian-buster.
Coincidentally I'm trying to get the same project running as the person who reported #39
I have installed the rest of the dependence for the project using the pip3 commands shown here. When I get to installing the python-lzo package I have tried the following commands:

pip3 install python-lzo
sudo pip3 install python-lzo
pip install python-lzo
sudo pip install python-lzo

Each time I get the output shown below.

This is my first use of a Linux/Python environment, so I'm in over my head and can really only follow instructions, however I have other programming experience and probably have just enough knowledge to be dangerous :(

Any help would be greatly appreciated.

Paul P

pip install python-lzo
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting python-lzo
Downloading https://files.pythonhosted.org/packages/af/60/41f17f56c920a956f1d4b9f04f9755c045b2b06b9dd933b33cdd37ab9fd7/python-lzo-1.12.tar.gz
Building wheels for collected packages: python-lzo
Running setup.py bdist_wheel for python-lzo ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-n7lczs/python-lzo/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-1EgNZ_ --python-tag cp27:
running bdist_wheel
running build
running build_ext
building 'lzo' extension
creating build
creating build/temp.linux-armv6l-2.7
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-9NJ3qw/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/lzo -I/usr/include/python2.7 -c lzomodule.c -o build/temp.linux-armv6l-2.7/lzomodule.o
lzomodule.c:35:10: fatal error: lzo/lzo1x.h: No such file or directory
#include <lzo/lzo1x.h>
^~~~~~~~~~~~~
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1


Failed building wheel for python-lzo
Running setup.py clean for python-lzo
Failed to build python-lzo
Installing collected packages: python-lzo
Running setup.py install for python-lzo ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-n7lczs/python-lzo/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-vxwMpV/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_ext
building 'lzo' extension
creating build
creating build/temp.linux-armv6l-2.7
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-9NJ3qw/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/lzo -I/usr/include/python2.7 -c lzomodule.c -o build/temp.linux-armv6l-2.7/lzomodule.o
lzomodule.c:35:10: fatal error: lzo/lzo1x.h: No such file or directory
#include <lzo/lzo1x.h>
^~~~~~~~~~~~~
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-n7lczs/python-lzo/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-vxwMpV/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-n7lczs/python-lzo/

0kit0 commented

Resolved by paying attention...
I ran:

sudo apt-get update
sudo apt-get upgrade
sudo reboot

(I'm sure I had done this before, might have forgot to reboot!)
Then:

sudo apt-get install liblzo2-dev
sudo -H pip3 install python-lzo

All installed now :)

I'm glad you figured it out.