zoukankan      html  css  js  c++  java
  • python 追加库路径

    node2:/root#cat a1.py 
    import sys
    print sys.path
    import mymodule
    node2:/root#
    node2:/root#python a1.py
    ['/root', '/usr/local/python27/lib/python27.zip', '/usr/local/python27/lib/python2.7', '/usr/local/python27/lib/python2.7/plat-linux2', '/usr/local/python27/lib/python2.7/lib-tk', '/usr/local/python27/lib/python2.7/lib-old', '/usr/local/python27/lib/python2.7/lib-dynload', '/usr/local/python27/lib/python2.7/site-packages', '/usr/local/python27/lib/python2.7/site-packages/setuptools-33.1.1-py2.7.egg', '/usr/local/python27/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg', '/usr/local/python27/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg', '/usr/local/python27/lib/python2.7/site-packages/dwebsocket-0.4.2-py2.7.egg', '/usr/local/python27/lib/python2.7/site-packages/requests_toolbelt-0.8.0-py2.7.egg', '/usr/local/python27/lib/python2.7/site-packages/certifi-2018.4.16-py2.7.egg']
    Traceback (most recent call last):
      File "a1.py", line 3, in <module>
        import mymodule
    ImportError: No module named mymodule
    
    node2:/root#cat a1.py
    import sys
    print sys.path
    sys.path.append('/root/python')
    import mymodule
    print mymodule.Str
    
    
    
    
  • 相关阅读:
    项目目标文档
    系统利益相关者描述案例
    软件需求模式 读书笔记二
    软件需求分析 读书笔记1
    专业实训题目需求分析
    2015年秋季个人阅读计划
    CodeVs 1615 数据备份
    HDU 3900 Unblock Me
    HDU 5898 odd-even number
    HDU 5877 Weak Pair
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349148.html
Copyright © 2011-2022 走看看