As the answer related to Matthew explains, your problem is almost certainly due to the fact that different versions of Python are used to compile and load the module. You can define the magic number as follows:
with open('pyuca.pyc', 'rb') as f: print struct.unpack('<H', f.read(2))
You can determine your version of Python by typing sys.version (this also repeats on interactive start). If you are using Python 2.6.6, the magic number should be 62161. If it is different, you will need to switch to another Python in order to be able to import the module.
The same goes for .pyo files.
user4815162342
source share