列出已安装的python网站软件包? [英] Listing installed python site-packages?
问题描述
from distutils.sysconfig import get_python_lib; print get_python_lib()
返回: /usr/lib/python2.6/站点软件包
import sys; print sys.path
返回: ['','/ usr / lib /python2.6/site-packages/Django-1.1.1-py2.6.egg'、'/usr/lib/python2.6/site-packages/pip-0.6.3-py2.6.egg',' /usr/lib/python2.6/site-packages/TRML2PDF-1.0-py2.6.egg'、'/usr/lib/python2.6/site-packages/django_threaded_multihost-1.3_3-py2.6.egg', ......
但是如何从网站上列出可导入名称-包安装好了吗?例如:(在导入结果之前) django,pip,trm2pdf...。
But how to list the "importable name" from the site-packages installed? E.g: (before import results) django, pip, trm2pdf....
谢谢。
推荐答案
查看蛋黄。
Yolk是Python命令行工具和库,用于获取有关setuptools,easy_install和distutils安装的软件包的信息(Python 2.5 )和查询PyPI(Python软件包索引又名The Cheese Shop)。
Yolk is a Python command-line tool and library for obtaining information about packages installed by setuptools, easy_install and distutils (Python 2.5) and for querying PyPI (Python Package Index a.k.a. The Cheese Shop).
这篇关于列出已安装的python网站软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!