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']
    >>>

  • 相关阅读:
    来自平时工作中的javascript知识的积累---持续补充中
    javascript function
    CSS3 3D变换
    HTTP1.1缓存策略
    jQuery插件开发
    mac下好用的工具收录(慢慢完善)
    mac 彻底卸载vscode
    Git冲突:commit your changes or stash them before you can merge. 解决办法(转载)
    关于vscode使用的一些设置
    (linux服务器)apache开启gzip的配置以及效果对比
  • 原文地址:https://www.cnblogs.com/wuxi/p/3191099.html
Copyright © 2011-2022 走看看