Re: Import error !!

  • Thread starter =?ISO-8859-1?Q?Gerhard_H=E4ring?=
  • Start date
?

=?ISO-8859-1?Q?Gerhard_H=E4ring?=

satish said:
Hello all,

I am trying to import a module which was generated by a PYTHON-C++ interface
generator tool, which failed, and generated the following error : [...]
# /usr/lib/python1.5/exceptions.pyc matches /usr/lib/python1.5/exceptions.py
import exceptions # precompiled from /usr/lib/python1.5/exceptions.pyc
# /usr/lib/python2.2/site.pyc has bad magic
'import site' failed; traceback:
File "/usr/lib/python2.2/site.py", line 64
dir = os.path.abspath(os.path.join(*paths))
^
SyntaxError: invalid syntax
Python 1.5.2 (#1, Apr 3 2002, 18:16:26) [GCC 2.96 20000731 (Red Hat Linux
7.2 2 on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
import readline # dynamically loaded from
/usr/lib/python1.5/lib-dynload/readline.so

I don't understand much from the above. Can someone suggest what this means ??

For some reason, your Pythons get mixed up (1.5.2 and 2.2). 1.5.2
doesn't understand the argument expansion operator * yet.

The first thing I'd check is the Python module search path (sys.path).
Maybe you're doing somethnig fancy like setting PYTHONPATH that causes
this problem? Also, on your old Redhat system, you'll have to run Python
2.2 with 'python2' instead of 'python'.

-- Gerhard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How to fix the bug about iconv for python? 1
python import error 7
django admin.py error 4
Import site 1
Runtime error 2
% operation 2
Import command 1
importing site fails - why? 3

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top