Re: [AMBER] Bad magic number ?

From: Jason Swails <jason.swails.gmail.com>
Date: Sat, 12 Mar 2011 08:20:59 -0800

Bill's description of what's happening is exactly right. Whoever installed
Amber must have used a different version of Python to compile the bytecode
(*.pyc files).

However, if you can recompile the bytecode with Python 2.7 (cd
$AMBERHOME/src/mmpbsa_py; python2.7 -c "import inputparse, utils, alamdcrd";
mv *.pyc $AMBERHOME/bin), then it will work fine.

Also like Bill said, the upcoming version of MMPBSA with AmberTools 1.5 is
far smarter in that whatever Python is used to build the bytecode is
hardcoded to be the python always used to launch MMPBSA.py, so this error
should never happen. This is true even if you force AmberTools to use the
system python instead of allowing it to build its own.

Hope this helps,
Jason

On Sat, Mar 12, 2011 at 7:02 AM, Bill Miller III <brmilleriii.gmail.com>wrote:

> This is a python error that is often describing using a version of python
> that is incompatible with the version of python that was used to create or
> compile the .pyc files. Honestly, I haven't tested MMPBSA.py with Python
> 2.7. You might want to try re-compiling MMPBSA.py using Python 2.6 and
> using
> that instead. I know MMPBSA.py is compatible with Python 2.6 and earlier
> versions of Python 2. This should fix your problem.
>
> As a side note, in the future AmberTools will compile and use its own
> version of Python to help avoid issues like this with the system's Python.
>
> -Bill
>
> On Sat, Mar 12, 2011 at 9:41 AM, Hector A. Baldoni <hbaldoni.unsl.edu.ar
> >wrote:
>
> > Hello,
> >
> > Trying to run mmpbsa.py I got the following error:
> >
> > Traceback (most recent call last):
> > File "/share/apps/amber11/exe/MMPBSA.py", line 43, in <module>
> > import inputparse, utils, alamdcrd # (2)
> > ImportError: Bad magic number in /share/apps/amber11/bin/inputparse.pyc
> >
> > What should I do to fix the problems?
> > My python version:
> > Python 2.7 (r27:82500, Oct 6 2010, 19:51:31)
> > [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
> >
> > Thanks,
> > Hector
> >
> >
> >
> > ---------------------------------
> > Dr. Hector A. Baldoni
> > Departamento de Quimica
> > Universidad Nacional de San Luis
> > Chacabuco 917 (D5700BWS)
> > San Luis - Argentina
> > hbaldoni at unsl.edu.ar
> > Tel.:+54-(0)2652-423789 ext. 157
> > ----------------------------------
> >
> >
> > _______________________________________________
> > AMBER mailing list
> > AMBER.ambermd.org
> > http://lists.ambermd.org/mailman/listinfo/amber
> >
>
>
>
> --
> Bill Miller III
> Quantum Theory Project,
> University of Florida
> Ph.D. Graduate Student
> 352-392-6715
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>



-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Sat Mar 12 2011 - 08:30:03 PST
Custom Search