[英]"ModuleNotFoundError: No module named 'dbus'" on macOS
我在使用 notify2 模塊時遇到錯誤。
ModuleNotFoundError:沒有名為“dbus”的模塊
錯誤來自 notify2.py 文件。
當我嘗試pip install dbus
時,這是 output:
ERROR: Could not find a version that satisfies the requirement dbus (from versions: none)
ERROR: No matching distribution found for dbus
當我嘗試brew install python-dbus
時:
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "python-dbus".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
我找不到與 macOS 相關的任何答案來解決此問題。
嘗試做pip install dbus-python
。 它在 Fedora 34 上對我有用。
不確定 MacOS,但基於 debian 的操作系統我解決了問題:
sudo apt-get update
sudo apt-get -y install libglib2.0-dev libdbus-1-3 libdbus-1-dev
按照這個這樣
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.