Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (45.3k points)

I am running an application in a virtual environment that needs access to DBus (to interact with the Network Manager, mainly).

I tried to install Dbus-Python with easyinstall and pip, but both fail.

When I try to do this:

(myvirtualenv)borrajax@borrajax-computer:~/Documents/Projects/VirtualEnvs/current_env$ bin/pip install dbus-python

Pip yells at me with:

Downloading/unpacking dbus-python

  Downloading dbus-python-1.1.1.tar.gz (596kB): 596kB downloaded

  Running setup.py egg_info for package dbus-python

    Traceback (most recent call last):

      File "<string>", line 16, in <module>

    IOError: [Errno 2] No such file or directory: '/home/borrajax/Documents/Projects/VirtualEnvs/current_env/build/dbus-python/setup.py'

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

  File "<string>", line 16, in <module>

IOError: [Errno 2] No such file or directory: '/home/borrajax/Documents/Projects/VirtualEnvs/current_env/build/dbus-python/setup.py'

----------------------------------------

Command python setup.py egg_info failed with error code 1 in /home/borrajax/Documents/Projects/VirtualEnvs/current_env/build/dbus-python

Storing complete log in /home/borrajax/.pip/pip.log

I've had some issues with the python dbus bindings and their "accessibility" from my Python modules in the past, so I don't really know what may be the best way to set Dbus-Python in a virtual environment. Has anyone successfully achieved this? Or does anyone have an idea on how to do this?

Thank you in advance.

1 Answer

0 votes
by (16.8k points)

When pip tries to install a package, it looks for setup.py, which dbus-python doesn't have, so you'll have to download the source and compile it manually. Shouldn't be too hard:

PYTHON=python3.3 ./configure --prefix=/tmp/dbus-python

make

make install

then, you can move the compiled files to your virtualenv.

Related questions

0 votes
1 answer
asked Nov 21, 2020 in Python by laddulakshana (16.4k points)
0 votes
1 answer

Browse Categories

...