altdesktop / python-dbus-next

🚌 The next great DBus library for Python with asyncio support
https://python-dbus-next.readthedocs.io/en/latest/
MIT License
191 stars 60 forks source link

The name org.freedesktop.NetworkManager was not provided by any .service #152

Closed smnodame closed 1 year ago

smnodame commented 1 year ago

I got this error message dbus_next.errors.DBusError: The name org.freedesktop.NetworkManager was not provided by any .service files

this is my code

from dbus_next.aio import MessageBus
import dbus_next.aio as dbus
import asyncio

async def main():
    bus = await MessageBus().connect()
    introspection = await bus.introspect('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager')
    bus.get_proxy_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager')

I have this bus path in my laptop Screenshot from 2023-03-30 16-41-20

and I have a question, why do I need this introspection, I used dbus-next in javascript before and it doesn't require https://www.npmjs.com/package/dbus-next

michallowasrzechonek-silvair commented 1 year ago

You're connecting to the session bus. See bus_type argument.

smnodame commented 1 year ago

OK got it. thank you so mucn