Python 通过 pip 安装时 Dbus 错误

Python Dbus Error while installing through pip

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.

我遇到了同样的问题。

可能不建议在 Windows.

上使用 dbus-python

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

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