systemd无法在raspbian python3上安装

bla*_*ack 2 python pip python-3.x systemd raspbian

我想安装systemdgithub)库。

但是,执行

sudo pip3 install systemd
Run Code Online (Sandbox Code Playgroud)

导致此错误:

命令“ /usr/local/bin/python3.6 -u -c”导入setuptools,标记化;file ='/ tmp / pip-install-c97m6cn0 / 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-record-gqnrg4wd/install-record.txt --single-版本外部管理的--compile“在/ tmp / pip-install-c97m6cn0 / systemd /中失败,错误代码为1

我试图升级setuptools,但这不能解决我的问题:

sudo pip3 install --upgrade setuptools
Run Code Online (Sandbox Code Playgroud)

这里是完整的控制台输出:

$ sudo pip3 install systemd Collecting systemd
使用缓存的 https://files.pythonhosted.org/packages/d4/c2/2195b049effd866b5d26926e672be83fc6f3263aa71ea0639e8eab44851e/systemd-0.16.1.tar.gz 为收集的软件包构建轮子:systemd为systemd运行setup.py bdist_wheel ...错误完整的输出结果命令/ usr / bin / python3 -u -c“导入setuptools,标记化;文件 ='/ tmp / pip-build-11re058x / 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 / tmpg851h3qzpip-wheel- --python-tag cp35:
/usr/lib/python3.5/distutils/dist.py:261:UserWarning:未知分发选项:'build_requires'warnings.warn(msg)运行bdist_wheel运行build运行build_py创建build创建build / lib.linux-armv6l-3.5
创建build / lib.linux-armv6l-3.5 / systemd复制systemd / daemon.py-> build / lib.linux-armv6l-3.5 / systemd复制systemd / journal.py-> build / lib.linux-armv6l-3.5 / systemd复制systemd / init.py-> build / lib.linux-armv6l-3.5 / systemd运行build_ext构建'systemd._daemon'扩展名,创建build / temp.linux-armv6l-3.5创建build / temp.linux-armv6l-3.5 / systemd arm-linux- gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map = / build / python3.5-RUbMX3 / python3.5-3.5.3 =。-fstack-protector-strong -Wformat -Werror =格式安全-Wdate-time -D_FORTIFY_SOURCE = 2 -fPIC -I / usr / include / python3.5m -c systemd / _daemon.c -o build / temp.linux-armv6l -3.5 / systemd / _daemon.o
systemd / _daemon.c:539:31:致命错误:systemd / sd-daemon.h:没有这样的文件或目录#include ^编译终止。错误:命令“ arm-linux-gnueabihf-gcc”失败,退出状态为1

---------------------------------------- systemd的建筑轮子失败运行setup.py clean for systemd无法构建systemd无法安装收集的软件包:systemd正在运行setup.py install for systemd ...错误从命令/ usr / bin / python3 -u -c“ import setuptools,tokenize; file ='/ tmp / pip- build-11re058x / systemd / setup.py'; f = getattr(tokenize,'open',open)(file); code = f.read()。replace('\ r \ n','\ n'); f.close(); exec(编译(代码,文件,'exec'))“安装--record /tmp/pip-lirhgtsu-record/install-record.txt-单版本-外部管理-编译:/usr/lib/python3.5/distutils/dist .py:261:用户警告:未知分发选项:'build_requires'警告复制systemd / daemon.py-> build / lib.linux-armv6l-3.5 / systemd复制systemd / journal.py-> build / lib.linux-armv6l-3.5 / systemd复制systemd / init.py-> build / lib.linux-armv6l-3.5 / systemd运行build_ext构建'systemd._daemon'扩展名,创建build / temp.linux-armv6l-3.5创建build / temp.linux-armv6l-3.5 / systemd arm-linux- gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map = / build / python3.5-RUbMX3 / python3.5-3.5.3 =。-fstack-protector-strong -Wformat -Werror =格式安全-Wdate-time -D_FORTIFY_SOURCE = 2 -fPIC -I / usr / include / python3.5m -c systemd / _daemon.c -o build / temp.linux-armv6l -3.5 / systemd / _daemon.o systemd / _daemon.c:539:31:致命错误:systemd / sd-daemon.h:没有这样的文件或目录#include ^编译终止。错误:命令“ arm-linux-gnueabihf-gcc”失败,退出状态为1

---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-11re058x/systemd/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n',
Run Code Online (Sandbox Code Playgroud)

'\ n'); f.close(); exec(compile(code,file,'exec')))“ install --record /tmp/pip-lirhgtsu-record/install-record.txt --single-version- / tmp / pip-build-11re058x / systemd /中,外部管理--compile“失败,错误代码为1

AKX*_*AKX 5

错误的相关部分是

fatal error: systemd/sd-daemon.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)

首先libsystemd-dev使用进行安装apt,您应该会很好:

sudo apt install libsystemd-dev
Run Code Online (Sandbox Code Playgroud)