本篇文章給大家分享的是有關(guān)Python中包的用法及安裝是怎么樣的,小編覺(jué)得挺實(shí)用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說(shuō),跟著小編一起來(lái)看看吧。
介紹了Python中一些常見(jiàn)的包的作用和安裝方法,希望對(duì)學(xué)習(xí)Python中的朋友有幫助!
Python中一些包的基本用處和安裝方法
pika可以用來(lái)連接RabbitMQ
pip install pika -i /tupian/20230522/ --trusted-host pypi.douban.com
requests是HTTP庫(kù)
Request支持HTTP連接保持和連接池,支持使用cookie保持會(huì)話,支持文件上傳,支持自動(dòng)響應(yīng)內(nèi)容的編碼,支持國(guó)際化的URL和POST數(shù)據(jù)自動(dòng)編碼。
pip install requests -i /tupian/20230522/ --trusted-host pypi.douban.com
SQLAlchemy是ORM框架
pip install SQLAlchemy -i /tupian/20230522/ --trusted-host pypi.douban.com
pymongo是連接mongodb的庫(kù)
pip install pymongo -i /tupian/20230522/ --trusted-host pypi.douban.com
MySQL-python是連接mysql的庫(kù)
apt-get install python-mysqldb
gearman分布式任務(wù)系統(tǒng)
pip install gearman -i /tupian/20230522/ --trusted-host pypi.douban.com
lxml是python的一個(gè)解析庫(kù),支持HTML和XML的解析
pip install lxml -i /tupian/20230522/ --trusted-host pypi.douban.com
elasticsearch庫(kù),es的客戶端庫(kù)
pip install elasticsearch -i /tupian/20230522/ --trusted-host pypi.douban.com
pycurl是curl庫(kù)
pip install pycurl -i /tupian/20230522/ --trusted-host pypi.douban.com
報(bào)錯(cuò)
__main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory
apt-get install libcurl4-openssl-dev
以上就是Python中包的用法及安裝是怎么樣的,小編相信有部分知識(shí)點(diǎn)可能是我們?nèi)粘9ぷ鲿?huì)見(jiàn)到或用到的。希望你能通過(guò)這篇文章學(xué)到更多知識(shí)。更多詳情敬請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。