【发布时间】:2009-08-11 17:29:50
【问题描述】:
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
【问题讨论】:
-
您是否设置了任何 PYTHON* 环境变量(执行“env | grep PYTHON”)?如果是这样,请尝试取消设置。
-
我检查了环境没有设置,它的CentOS 5.3
-
sys.path ("import sys; sys.path") 的值是多少?
-
>>> sys.path ['', '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5', '/usr/local/ lib/python2.5/plat-linux2'、'/usr/local/lib/python2.5/lib-tk'、'/usr/local/lib/lib-dynload'、'/usr/local/lib/python2 .5/site-packages']
-
注意如何重新导入。你从哪里得到这个 Python 发行版?我会从 python.org 卸载并重新安装一个版本。
标签: python configuration