gpt4 book ai didi

python - 列出已安装的 python 站点包?

转载 作者:太空狗 更新时间:2023-10-29 17:56:02 25 4
gpt4 key购买 nike

<分区>

from distutils.sysconfig import get_python_lib; print get_python_lib()

返回:/usr/lib/python2.6/site-packages

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....

谢谢。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com