通过pip安装时出现Python Dbus错误

2024-10-02 16:26:40 发布

您现在位置:Python中文网/ 问答频道 /正文

python -m  pip install dbus-python
Collecting dbus-python
  Using cached dbus-python-1.2.16.tar.gz (576 kB)
Using legacy 'setup.py install' for dbus-python, since package 'wheel' is not installed.
Installing collected packages: dbus-python
    Running setup.py install for dbus-python ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\pure8\AppData\Local\Temp\pip-record-l_6vpx3k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\Include\dbus-python'
         cwd: C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\
    Complete output (5 lines):
    running install
    running build
    creating C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\build
    creating C:\Users\pure8\AppData\Local\Temp\pip-install-zphzgd3p\dbus-python\build\temp.win-amd64-3.8
    error: [WinError 193] %1 is not a valid Win32 application
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\pure8\\AppData\\Local\\Temp\\pip-install-zphzgd3p\\dbus-python\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\pure8\AppData\Local\Temp\pip-record-l_6vpx3k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\pure8\AppData\Local\Programs\Python\Python38\Include\dbus-python' Check the logs for full command output.

every time I try to install dbus it gives me an error, I tried installing 32 bit and 64 bit of new python updates, and they are added to PATH, but that didn't help to install dbus. Dbus is required for notify2.


Tags: installpippyforlocalsetuprecordusers
1条回答
网友
1楼 · 发布于 2024-10-02 16:26:40

我也遇到了同样的问题

也许不建议在Windows上使用dbus python

我只是将文件夹/usr/local/lib/python2.7/dist-packages/dbus(Linux)移动到Python2.7文件夹(Windows)

我可以通过Ctrl+鼠标(左)在VScode中看到DBU

相关问题 更多 >