2017-06-01 98 views
0

我想列出我的機器上運行SL7.3(因此Python 2.7.5)的所有軟件包安裝。我嘗試運行命令help("modules"),但我得到以下錯誤。任何人都可以幫忙謝謝python list module分割錯誤

Python 2.7.5 (default, Nov 3 2016, 22:05:29) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> help("modules") 

Please wait a moment while I gather a list of all available modules... 

dm.c: 1693: not running as root returning empty list 
/usr/lib64/python2.7/site-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0' failed 
    import gobject._gobject 
/usr/lib64/python2.7/site-packages/matplotlib/cbook.py:136: MatplotlibDeprecationWarning: The matplotlib.delaunay module was deprecated in version 1.4. Use matplotlib.tri.Triangulation instead. 
    warnings.warn(message, mplDeprecation, stacklevel=1) 
/usr/lib64/python2.7/pkgutil.py:110: FutureWarning: The pandas.rpy module is deprecated and will be removed in a future version. We refer to external packages like rpy2. 
See here for a guide on how to port your code to rpy2: http://pandas.pydata.org/pandas-docs/stable/r_interface.html 
    __import__(name) 
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: Warning: specified class size for type 'PyGtkGenericCellRenderer' is smaller than the parent type's 'GtkCellRenderer' class size 
    from gtk import _gtk 
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion 'node != NULL' failed 
    from gtk import _gtk 
Segmentation fault (core dumped) 
+0

你最好不要使用類似'點子freeze'或只是爲了尋找在'site-packages'中。你正在使用的命令嘗試加載所有模塊,如果有任何衝突,它會爆炸。 – pvg

+0

感謝pip freeze/list完成了這項工作。 –

回答

0

PIP列表

這是幫你?

,或者使用下面的代碼來看

進口PIP

的DIST在pip.get_installed_distributions():

 print(dist) 
+0

感謝pip freeze/list完成了這項工作。 –