Odoo Help

Welcome!

This community 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.

0

ImportError: Bad magic number while compiling.py

By
Andrew
on 10/17/13, 5:20 AM 1,898 views

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

importmoves.py:

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]
else:
    print 'cant open file'

my.csv

shift,1
seat,2
steer,1

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
ves.py
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
041\Server\server\logging\__init__.pyc

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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