468,294 Members | 1,829 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,294 developers. It's quick & easy.

Bad Magic Number with only .py deployed

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

Oct 19 '06 #1
0 1123

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Dave Moore | last post: by
2 posts views Thread by stewart.midwinter | last post: by
19 posts views Thread by youpak2000 | last post: by
19 posts views Thread by eric.nave | last post: by
16 posts views Thread by per9000 | last post: by
4 posts views Thread by inferi9 | last post: by
14 posts views Thread by Phil | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.