zoukankan      html  css  js  c++  java
  • 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']
    >>>

  • 相关阅读:
    优化Hibernate所鼓励的7大措施:
    Java未赋值变量的默认初始值
    年轻代
    JVM介绍
    Java锁的种类以及辨析
    java语言复制数组的四种方法
    static和final
    抽象函数抽象类
    try catch finally
    九大内置对象
  • 原文地址:https://www.cnblogs.com/wuxi/p/3191099.html
Copyright © 2011-2022 走看看