gpt4 book ai didi

python - systemd 无法在 raspbian python3 上安装

转载 作者:行者123 更新时间:2023-11-28 20:58:42 24 4
gpt4 key购买 nike

我想安装 systemd ( github ) 库。

但是,执行

sudo pip3 install systemd

导致此错误:

Command "/usr/local/bin/python3.6 -u -c "import setuptools, tokenize;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-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-c97m6cn0/systemd/

我尝试升级设置工具,但这并没有解决我的问题:

sudo pip3 install --upgrade setuptools

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

$ sudo 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-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: Unknown distribution option: 'build_requires' warnings.warn(msg) running bdist_wheel running build running build_py creating build creating build/lib.linux-armv6l-3.5
creating build/lib.linux-armv6l-3.5/systemd copying systemd/daemon.py -> build/lib.linux-armv6l-3.5/systemd copying systemd/journal.py -> build/lib.linux-armv6l-3.5/systemd copying systemd/init.py -> build/lib.linux-armv6l-3.5/systemd running build_ext building 'systemd._daemon' extension creating build/temp.linux-armv6l-3.5 creating 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=format-security -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: fatal error: systemd/sd-daemon.h: No such file or directory #include ^ 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-11re058x/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-lirhgtsu-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-armv6l-3.5 creating build/lib.linux-armv6l-3.5/systemd copying systemd/daemon.py -> build/lib.linux-armv6l-3.5/systemd copying systemd/journal.py -> build/lib.linux-armv6l-3.5/systemd copying systemd/init.py -> build/lib.linux-armv6l-3.5/systemd running build_ext building 'systemd._daemon' extension creating build/temp.linux-armv6l-3.5 creating 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=format-security -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: fatal error: systemd/sd-daemon.h: No such file or directory #include ^ 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-11re058x/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-lirhgtsu-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-11re058x/systemd/

最佳答案

错误的相关部分是

fatal error: systemd/sd-daemon.h: No such file or directory

首先使用apt安装libsystemd-dev,然后你就可以开始了:

sudo apt install libsystemd-dev

关于python - systemd 无法在 raspbian python3 上安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51264020/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com