我的 sys.path 如下所示:
/homel/ychao/python/python_lib
/usr/lib64/python27.zip
/usr/lib64/python2.7
/usr/lib64/python2.7/plat-linux2
/usr/lib64/python2.7/lib-tk
/usr/lib64/python2.7/lib-old
/usr/lib64/python2.7/lib-dynload
/usr/lib64/python2.7/site-packages
/usr/lib64/python2.7/site-packages/PIL
/usr/lib64/python2.7/site-packages/gst-0.10
/usr/lib64/python2.7/site-packages/gtk-2.0
/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode
/usr/lib/python2.7/site-packages
/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info
/usr/lib/python2.7/site-packages/IPython/extensions
我注意到有一些目录都是子目录/usr/lib64/python2.7,怎么会这样?当我删除所有子目录并使 sys.path 像这样:
/homel/ychao/python/python_lib
/usr/lib64/python2.7
/usr/lib/python2.7/site-packages
我之前可以导入的一些包在修改后会失败。所以这意味着“导入”不知道递归地找到合适的包?
谢谢!