Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8991277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:41:18+00:00 2026-06-15T22:41:18+00:00

I tried the code below in interactive python shell and got the follow error

  • 0

I tried the code below in interactive python shell and got the follow error in line 3 of code, using D-Feet I see that path and interface exists in bus, and with the command dbus-send I able to get the devices, see in end of this message. Why not work with this code in python? PS: I using ubuntu 12.04, tried too in ubuntu 11, same problem.

Code:

import dbus
bus = dbus.SessionBus()
obj = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager')
t = dbus.Interface(obj, "org.freedesktop.NetworkManager")
t.GetDevices()

Output error entering line 3 of code:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/dbus/bus.py", line 244, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/pymodules/python2.7/dbus/proxies.py", line 241, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/pymodules/python2.7/dbus/bus.py", line 183, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/pymodules/python2.7/dbus/bus.py", line 281, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/pymodules/python2.7/dbus/connection.py", line 630, in call_blocking
    message, timeout)
DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager was not provided
 by any .service files

Shell command that work:

dbus-send --system --print-reply --reply-timeout=2000 --type=method_call --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.GetDevices

Output:

method return sender=:1.2 -> dest=:1.69 reply_serial=2
   array [
      object path "/org/freedesktop/NetworkManager/Devices/0"
   ]

This is just a example, I wish to know why don’t work, If I change line 3 to (note the DBus name in first parameter):

obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/NetworkManager')

the error don’t occur, but in this interface the method GetDevices doesn’t exists.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:41:20+00:00Added an answer on June 15, 2026 at 10:41 pm

    In your command line example you’re asking for the system bus:

    dbus-send --system ...
    

    In your Python code, you’re asking for the session bus:

    bus = dbus.SessionBus()
    

    If you try the request over the system bus, I think you’ll find that it works:

    >>> import dbus
    >>> bus = dbus.SystemBus()
    >>> obj = bus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager')
    >>> t = dbus.Interface(obj, "org.freedesktop.NetworkManager")
    >>> t.GetDevices()
    dbus.Array([dbus.ObjectPath('/org/freedesktop/NetworkManager/Devices/0'), dbus.ObjectPath('/org/freedesktop/NetworkManager/Devices/1')], signature=dbus.Signature('o'))
    >>> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried code below in .NET 3.5 but got exception at line shown in
I have tried using the code below but it only display results in Chrome
I tried accessing web for xml parsing using the code below: System.Uri proxy =
When i tried using the below code...the td tag is returned and not the
I'm using Galasoft's EventToCommand as code below to update Line Total cell after user
I tried using the code below to set up a contextmenu which only displays
I tried below code but as I run it gives a black screen image
I have tried rectifying the code below. But I am not able to find
I tried the below code to check whether my mobile is connected to a
I want to send data through URL.I've tried the below code: Intent browserIntent =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.