Python 如何根据关键词查询包名

当使用pip安装Python库时,如果不确定包名,可以借助`apt-cache search`来查找准确的包名。本文以lxml为例,介绍了如何通过`apt-cache`搜索并查看包的详细信息,包括依赖关系和安装状态。
摘要由CSDN通过智能技术生成

参考资料:http://blog.csdn.net/xia7139/article/details/9113433


相信用过python的同学都碰到过利用pip install的时候 发现安装程序找不到该包名的安装包,因为python包名不一定和库名完全相同。那么 如何根据关键词查询包名?

以安装lxml为例:

1. 先用 apt-cache search找到软件的准确名字
apt-cache search lxml  
结果:  
inkscape - vector-based drawing program  
python-lxml - pythonic binding for the libxml2 and libxslt libraries  
python-lxml-dbg - pythonic binding for the libxml2 and libxslt libraries (debug extension)  
python-lxml-doc - pythonic binding for the libxml2 and libxslt libraries (documentation)  
python3-lxml - pythonic binding for the libxml2 and libxslt libraries  
python3-lxml-dbg - pythonic binding for the libxml2 and libxslt libraries (debug extension)  
xml-core - XML infrastructure and XML catalog file support  
python-okasha - trivial WSGI w

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值