Compiling dbus-python-1.0.0 for python3 on ubuntu…and making it work.

It took me a fair amount of time to get dbus-python-1.0.0 building and properly installing for python3 on my ubuntu system, so I figured I’d make a record of what I had to do. Note that I use the grep replacement grin in this work.

After unpacking the source, first configure the build with the correct version of python:

PYTHON=python3.2 ./configure

It’s critical that you use the full python version, not just e.g. “python3”. The build determines where to install stuff based on this string, and “python3” was putting code outside of my sys.path.

Then, I had to run ‘make’ to sort of “wake up” the autoconf system. That stuff is all a big mystery to me, for the most part, but I’ve learned to work around it.

Any, after the initial build I had to replace all uses of “site-packages” in the source with “dist-packages”:

grin -l site-packages | xargs sed -i -e 's/site-packages/dist-packages/'

This again had to do with sys.path, which doesn’t include site-packages by default. Whatever. With that done, I did a “make clean” followed by another “make”. Finally, I did normal “make install” put everything in the right place.

Here the sum of the operations:

tar zxvf dbus-python-1.0.0.tar.gz
cd dbus-python-1.0.0
PYTHON=python3.2 ./configure
grin -l site-packages | xargs sed -i -e 's/site-packages/dist-packages/'
make clean
sudo make install

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: