Page 1 of 1

Jaunty Jackalope (Kubuntu 9.04)

Posted: Sun Apr 26, 2009 8:20 pm
by Brother Mike
Hello intrepid programmer (Tim)

I just upgraded to Jaunty Jackalope (Kubuntu version 9.04).

When I try to run BibleAnalyzer, I get the following error:

************ Starting Bible Analyzer *************
Traceback (most recent call last):
File "/usr/share/bibleanalyzer/analyzer3.py", line 3, in <module>
import wx, re, wx.html, images, string, sys, cStringIO, os
ImportError: Bad magic number in /usr/share/bibleanalyzer/images.pyc

Looks like it broke something. :(

Re: Jaunty Jackalope (Kubuntu 9.04)

Posted: Sun Apr 26, 2009 10:49 pm
by Brother Mike
Well, I think I know, after some research, what is causing the problem (Python version mismatch), I am not sure if I have what is necessary to fix it.

Re: Jaunty Jackalope (Kubuntu 9.04)

Posted: Mon Apr 27, 2009 12:02 pm
by Tim
I have a CD of 9.04 ordered and will have to wait until it arrives before I can test it with Bible Analyzer. Any of the dependencies of Bible Analyzer can be updated if available. That may be the issue. Frankly, I don't know what a "Magic Number" is. Wait and see, I guess.

If you find a fix or workaround, let me know.

Re: Jaunty Jackalope (Kubuntu 9.04)

Posted: Mon Apr 27, 2009 12:23 pm
by Brother Mike
From what I have been able to find, it has to do with trying to import a compiled python program in a version other than the one compiled on. I found this:

This happens when you have a .pyc file that was compiled by a
different version from the Python you are trying to import
it with. Normally, if the corresponding .py file is around,
this is not a problem, because Python will automatically
recompile and produce a new .pyc file. So it seems that
you don't have the original .py file around here, or it
cannot be recompiled for some reason. (If they are both
present, you could try removing that .pyc file.)

Or you can try to find out what Python version is used, and
install that version...


And this:

The magic number comes from UNIX-type systems where the first few bytes of a file held a marker indicating the file type.

Python puts a similar marker into its pyc files when it creates them.

Then the python interpreter makes sure this number is correct when loading it.

Anything that damages this magic number will cause your problem. This includes editing the pyc file or trying to run a pyc from a different version of python (usually later) than your interpreter.

If they're your pyc files, delete them and let the interpreter re-compile the py files.

If they're not yours, you'll have to either get the py files or an interpreter that can run the pyc files with that particular magic value.


I will make an offer to you, if you want to send me (email, ftp, etc) the images.py and/or others, I will be happy to test this theory for you. I do not have jaunty in front of me at the moment, so I cannot see what version of python it is running. I did find a good site that shows what the magic numbers are for each python release:

http://stackoverflow.com/questions/5143 ... mber-error

Re: Jaunty Jackalope (Kubuntu 9.04)

Posted: Mon Apr 27, 2009 4:15 pm
by Tim
Yes, that makes sense. The .pyc files in the .deb file were compiled with Python 2.5. I would say Jaunty has 2.6, but I haven't checked.

Yes, I can send you just the raw files, but give me a couple days until I get off work. I also have a couple fixes ready.

Re: Jaunty Jackalope (Kubuntu 9.04)

Posted: Mon Apr 27, 2009 5:22 pm
by Brother Mike
Sounds good.