Pithos won't run from /usr/bin after latest update.

Asked by Beam

Maybe I did something dumb, but after updating to the latest revision, I can't get Pithos to run from /usr/bin after install. It does run from the /bin directory under my checked out copy, but does not run from /usr/bin. I will provide the traceback and maybe somebody can tell me if I goofed or maybe something changed in the new revision that caused this. Possibly the "only one instance" thing?

Traceback (most recent call last):
  File "/usr/bin/pithos", line 53, in <module>
    from pithos.dbus_service import PithosDBusProxy, try_to_raise
ImportError: cannot import name try_to_raise

Anyway, I didn't want to report this as a bug because I thought it was probably my fault. Thanks for any help!

Austin

Question information

Language:
English Edit question
Status:
Solved
For:
Pithos Edit question
Assignee:
No assignee Edit question
Solved by:
Kevin Mehall
Solved:
Last query:
Last reply:
Revision history for this message
Kevin Mehall (kevin-mehall) said :
#1

I'm unable reproduce this, so it doesn't seem like there's anything wrong with the changes. It looks like your dbus_service.py didn't get updated or it is attempting to load the wrong version. Here's my guess at what's wrong:

If you're installing with setup.py, remember to pass it --prefix=/usr/ , since distutils defaults to /usr/local. $PATH chooses /usr/local/bin over /usr/bin, but python's sys.path puts /usr first. When you run pithos, you're launching the updated copy from /usr/local, but it imports the dbus_service.py from the old version in /usr.

Thanks for testing the trunk version, by the way! With all the extensive recent changes, I'm reluctant to put it in the PPA quite yet. Please let me know if you find anything broken.

Revision history for this message
Beam (austinbeam) said :
#2

Hmmm...well I did install with '--prefix=/usr/' initially, so I don't think that's the issue. I went ahead and tried it again, but still no luck. Then I tried deleting the pithos directory in /usr/share and then running the install again, but still no luck. Any other ideas?

Don't thank me, thank you! I'm more than happy to help test software, especially when a developer works so fervently. The functionality offered by Pithos is exactly what I had been looking for, so I'm thrilled to contribute in any way possible. I have been trying my best to break it, but so far this is the only issue I have encountered. Best of luck and keep up the great work!

Thanks
Austin

Revision history for this message
Kevin Mehall (kevin-mehall) said :
#3

Hmm... well, the directory in /usr/share is only the icons and glade files. The python modules install to /usr/lib/python2.6/site-packages/pithos
So maybe try checking if the dbus_service.py there matches the one in bzr (namely, if it defines the try_to_raise function at the end) and/or try deleting and re-installing those files. Another possibility is if the .pyc files aren't being updated, but I would hope distutils would take care of that, and I think python warns you if the pyc files are outdated and it doesn't have write permissions to update them. Deleting that directory and reinstalling should fix that, I think.

Revision history for this message
Kevin Mehall (kevin-mehall) said :
#4

Actually, it's /usr/share/pyshared/pithos

Revision history for this message
Kevin Mehall (kevin-mehall) said :
#5

Or, it may be in both. It seems setup.py installs to one, while the deb installs to the other...which could explain where it's finding an obsolete copy. Try removing the copy installed by apt-get. (You'll probably have to reinstall with setup.py afterwards, since apt-get will delete the files they have in common, like /usr/bin/pithos)

Revision history for this message
Beam (austinbeam) said :
#6

That was it. I forgot I had initially installed from the PPA. Unfortunately, now I am getting another error. Here is the traceback:

Traceback (most recent call last):
  File "/usr/bin/pithos", line 49, in <module>
    from pithos import AboutPithosDialog, PreferencesPithosDialog, StationsDialog
ImportError: No module named pithos

I have also been getting a warning from setup.py, but it seems to be irrelevant, let me know if I'm wrong:

WARNING: the following files are not recognized by DistUtilsExtra.auto:
  debug

Sorry about the hassle.

Revision history for this message
Best Kevin Mehall (kevin-mehall) said :
#7

Wow, distutils is even more screwed up than I thought. Using --prefix=/usr/ causes the modules to be installed in a site-packages directory that isn't on python's default path. The Ubuntu/Debian recommendation seems to be to be to install to /usr/local. I tested and --prefix=/usr/local works correctly as long as you do not have a copy from apt-get in /usr. Note that you have to explicitly specify the prefix, even though it defaults to /usr/local, or else it won't update the data path correctly and you'll get other errors. I'll update the build directions on the web site.

Revision history for this message
Kevin Mehall (kevin-mehall) said :
#8

I also added a build_deb.sh script to the repository, so it may be simpler just to run it and then install the .deb created in the parent directory.

Revision history for this message
Beam (austinbeam) said :
#9

Thanks for all of your help Kevin, installing to /usr/local solved my problem. I will probably use the script in the future as well...that will be really simple. Thanks for that!

Have a great day!

Revision history for this message
Beam (austinbeam) said :
#10

Thanks Kevin Mehall, that solved my question.