Cannot install systemd module via pip or apt due to compile errors or missing dependencies?
dachshund-digital opened this issue · 1 comments
Cannot install systemd module via pip or apt due to compile errors or missing dependencies?
pip install fails when gcc compile fails...
pip3 install systemd
Collecting systemd
Using cached https://files.pythonhosted.org/packages/d4/c2/2195b049effd866b5d26926e672be83fc6f3263aa71ea0639e8eab44851e/systemd-0.16.1.tar.gz
Building wheels for collected packages: systemd
Running setup.py bdist_wheel for systemd ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-5atcutw4/systemd/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/tmpbbf8vpxjpip-wheel- --python-tag cp35:
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'build_requires'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.5
creating build/lib.linux-armv7l-3.5/systemd
copying systemd/journal.py -> build/lib.linux-armv7l-3.5/systemd
copying systemd/init.py -> build/lib.linux-armv7l-3.5/systemd
copying systemd/daemon.py -> build/lib.linux-armv7l-3.5/systemd
running build_ext
building 'systemd._daemon' extension
creating build/temp.linux-armv7l-3.5
creating build/temp.linux-armv7l-3.5/systemd
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6waWnr/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c systemd/_daemon.c -o build/temp.linux-armv7l-3.5/systemd/_daemon.o
systemd/_daemon.c:539:31: fatal error: systemd/sd-daemon.h: No such file or directory
#include <systemd/sd-daemon.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
Failed building wheel for systemd
Running setup.py clean for systemd
Failed to build systemd
Installing collected packages: systemd
Running setup.py install for systemd ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-5atcutw4/systemd/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-cwvu2w6c-record/install-record.txt --single-version-externally-managed --compile:
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'build_requires'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.5
creating build/lib.linux-armv7l-3.5/systemd
copying systemd/journal.py -> build/lib.linux-armv7l-3.5/systemd
copying systemd/init.py -> build/lib.linux-armv7l-3.5/systemd
copying systemd/daemon.py -> build/lib.linux-armv7l-3.5/systemd
running build_ext
building 'systemd._daemon' extension
creating build/temp.linux-armv7l-3.5
creating build/temp.linux-armv7l-3.5/systemd
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6waWnr/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c systemd/_daemon.c -o build/temp.linux-armv7l-3.5/systemd/_daemon.o
systemd/_daemon.c:539:31: fatal error: systemd/sd-daemon.h: No such file or directory
#include <systemd/sd-daemon.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-5atcutw4/systemd/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-cwvu2w6c-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-5atcutw4/systemd/
And via APT...
apt install python-systemd
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-systemd is already the newest version (233-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python-systemd (233-1) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in
from debpython.version import SUPPORTED, debsorted, vrepr,
File "/usr/share/python/debpython/version.py", line 24, in
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-systemd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
python-systemd
E: Sub-process /usr/bin/dpkg returned an error code (1)
systemd/_daemon.c:539:31: fatal error: systemd/sd-daemon.h: No such file or directory
You need the libsystemd-devel headers installed for compilation to work. pip doesn't know anything about system libraries, so this is something that needs to be handled before calling pip.
dpkg: error processing package python-systemd (--configure):
That's strange. I have no idea why the installation of the debian package would fail. Most likely something was broken in your installation. Anyway, that would be a distro issue, not something to resolve here.