python 目录错误问题

现象:

[develop@vio2:~/devel/src/core/ee/script]$python drop_all.py
Traceback (most recent call last):
  File "drop_all.py", line 2, in <module>
    import database
  File "/home/develop/devel/database/__init__.py", line 4, in <module>
    from uom import *
  File "/home/develop/devel/database/uom.py", line 9, in <module>
    from connect import *
  File "/home/develop/devel/database/connect.py", line 9, in <module>
    import sqlalchemy
ImportError: No module named sqlalchemy

查看安装目录:

[develop@vio2:~/devel/src/core/ee/script]$python
Python 2.7.3 (default, Mar 11 2013, 14:03:18) [C] on aix6
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/home/develop/devel', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-aix6', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']
>>>

 

正确目录:

>>> import sys
>>> print sys.path
['', '/opt/freeware/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/opt/freeware/lib/python2.6/site-packages/Jinja2-2.6-py2.6.egg', '/home/develop/devel', '/opt/freeware/lib/python26.zip', '/opt/freeware/lib/python2.6', '/opt/freeware/lib/python2.6/plat-aix5', '/opt/freeware/lib/python2.6/lib-tk', '/opt/freeware/lib/python2.6/lib-old', '/opt/freeware/lib/python2.6/lib-dynload', '/opt/freeware/lib/python2.6/site-packages']
>>>

posted @ 2013-07-15 14:28  wuxi812  阅读(344)  评论(0编辑  收藏  举报