Reputation: 14335
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 2.5.2 (r252:60911, Aug 8 2009, 17:18:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> import operator
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named operator
Upvotes: 1
Views: 8045
Reputation: 11
I renamed the /usr/local/bin/python file and the error went away. I suspect this was an old version of python because I have a file python2.7 in the same directory.
Upvotes: 1
Reputation: 85045
Reiterating what I said earlier in a comment: re is a pure python module. You should see it in /usr/local/lib/python25{,.zip}
. operator is a C module; it should be in /usr/local/lib/lib-dynload
. If not, your installation is faulty and, yes, you should reinstall.
Upvotes: 0
Reputation: 881635
Module operator
should come from file operator.so
, presumably in /usr/local/lib/lib-dynload
in your case since that seems to be where you've installed things. So what .so files are in that directory?
Assuming operator.so is indeed missing (i.e., assuming it's not some trivial case of wrong permissions on some directory or file) the best way to "get it back" is no doubt, as a comment already suggested, to reinstall Python 2.5 (assuming you need that release e.g. to work with app engine) from either an official Python package at python.org, or an official CentOS 5.3 one (if one exists -- I believe CentOS 5.3 uses Python 2.4 as the official /usr/bin/python but there may be RPMs to place 2.5 somewhere else).
Upvotes: 1