[英]systemd fails to install on raspbian python3
我想安裝systemd
( github ) 庫。
但是,執行
sudo pip3 install systemd
導致這個錯誤:
命令“/usr/local/bin/python3.6 -u -c”導入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" 在 /tmp/pip-install-c97m6cn0/systemd/ 中失敗,錯誤代碼為 1
我嘗試升級 setuptools,但這並沒有解決我的問題:
sudo pip3 install --upgrade setuptools
這里是完整的控制台輸出:
$ sudo pip3 install systemd Collecting systemd
使用緩存的https://files.pythonhosted.org/packages/d4/c2/2195b049effd866b5d26926e672be83fc6f3263aa71ea0639e8eab44851e/systemd-0.16.1.tar.gz收集 systemd_wheel 的完整輸出包,用於收集 systemd_wheel 的系統 bdwheel 安裝程序的輸出。 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 創建構建創建 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=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:致命錯誤:systemd/sd-daemon.h:沒有這樣的文件或目錄#include ^ 編譯終止。 錯誤:命令“arm-linux-gnueabihf-gcc”失敗,退出狀態為 1------------------------------------------------ systemd 的構建輪失敗運行 setup.py clean對於 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(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 創建構建創建 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 running build_ext building '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=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: 致命錯誤: systemd/sd-daemon.h: No such file or directory #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',
'\\n');f.close();exec(compile(code, file , 'exec'))" install --record /tmp/pip-lirhgtsu-record/install-record.txt --single-version-外部管理的 --compile" 失敗,錯誤代碼 1 在 /tmp/pip-build-11re058x/systemd/
錯誤的相關部分是
fatal error: systemd/sd-daemon.h: No such file or directory
首先使用apt
安裝libsystemd-dev
,你應該很高興:
sudo apt install libsystemd-dev
此命令將在您的系統中安裝systemd
。
sudo apt-get install python-systemd
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.