Python引用包路径查询
解释器包检索路径查询
sys.path特指模块的查询路径的列表,初始化是从环境变量PYTHONPATH
import sys
from pprint import pprint
pprint(sys.path)
指定lib包路径查询
import imp
# 检索package setuptools位置
imp.find_module('setuptools')
# output:
# (None, '/usr/lib/python2.7/dist-packages/setuptools', ('', '', 5))