Odoo Help


ImportError: Bad magic number while compiling.py

on 10/17/13, 5:20 AM 2,006 views

I have created importmoves.py and my.csv in C:\Program Files (x86)\OpenERP 7.0-20130921-231041\Server\server


import openerp
import xmlrpclib
import csv
from openerp import pooler, sql_db
from openerp.osv import osv

cFileName = 'boatimport.csv'
reader = csv.reader(open(cFileName, 'rb'))

if reader:
    for row in reader:
        print row[0]
        print row[1]
    print 'cant open file'



I installed python-2.7.amd64.msi on my windows 7x64, and try to compile using python:

python importmoves.py

and I get the Bad magic number error:

C:\Program Files (x86)\OpenERP 7.0-20130921-231041\Server\server>python importmo
Traceback (most recent call last):
  File "importmoves.py", line 1, in <module>
    import openerp
  File "C:\Program Files (x86)\OpenERP 7.0-20130921-231041\Server\server\openerp
\__init__.py", line 39, in <module>
    import addons
  File "C:\Program Files (x86)\OpenERP 7.0-20130921-231041\Server\server\openerp
\addons\__init__.py", line 38, in <module>
    from openerp.modules import get_module_resource, get_module_path
  File "C:\Program Files (x86)\OpenERP 7.0-20130921-231041\Server\server\openerp
\modules\__init__.py", line 27, in <module>
    from . import db, graph, loading, migration, module, registry
  File "C:\Program Files (x86)\OpenERP 7.0-20130921-231041\Server\server\openerp
\modules\db.py", line 24, in <module>
    import logging
ImportError: Bad magic number in C:\Program Files (x86)\OpenERP 7.0-20130921-231

Any clue?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 10/17/13, 5:20 AM
Seen: 2006 times
Last updated: 3/16/15, 8:10 AM