By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,092 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,092 IT Pros & Developers. It's quick & easy.

Bad Magic Number with only .py deployed

P: n/a
I have a package of python modules deployed on an NFS mount on my
network that I use for sysadmin tools. Since some of the machines use
different versions of python I've only put the .py files in the mounted
share. However, I'm getting ImportError: Bad Magic Number when I try
to load any of the modules from the mount point. All the discussions I
can find say that a bad magic number should only occur with a
mismatched interpreter and compiled .pyc, but all that's deployed is
the .py. This should mean that any scripts that load the modules will
compile on import and so the interpreter should always be the same, but
that doesn't seem to be the case. Could this be a permission issue?
Does the interpreter panic and say Bad Magic Number if it can't write
to the same location as the .py files are? There are only 3 versions
of python on the network, but I'd rather not have to compile against
each. Actually, I just tried it again and /usr/bin/python, which is
2.3.3 imports the top level module fine, but one of the network mounted
version, which is 2.5, gives the Bad Magic Number problem on
lib/__init__.py. Neither of the intrepreters should be writing the
..pyc, so I don't see how they can get a Bad Magic Number from their own
stuff.

Oct 19 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.