You should check the actual full stack trace when the import fails?Īs an aside, the first word of all my 2.5.1(r251:54863) pyc files is 62131, 2.6.1(r261:67517) is 62161. It's highly unlikely it would import sometimes. The pyc that's causing the problem may only be imported under certain conditions. One thing that might be causing the intermittent nature. If they are not yours, you'll have to either get the py files for re-compilation, or an interpreter that can run the pyc files with that particular magic value. On UNIX type systems, that could be something as simple as: rm *.pyc If they are your pyc files, just delete them and let the interpreter re-compile the py files. This includes editing the pyc file or trying to run a pyc from a different version of python (usually later) than your interpreter. Then the python interpreter makes sure this number is correct when loading it.Īnything that damages this magic number will cause your problem. Python puts a similar marker into its pyc files when it creates them. The magic number comes from UNIX-type systems where the first few bytes of a file held a marker indicating the file type.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |