方法一:cmd命令行執(zhí)行pip install pandas
1.Windows+R,輸入cmd打開命令行窗口,輸入pip install pandas。
如下圖所示
2.若出現(xiàn)下圖所示的告警,說明版本有沖突。
按照提示輸入pip install --upgrade pip,對(duì)pip進(jìn)行升級(jí)
3.若出現(xiàn)下圖所示的升級(jí)報(bào)錯(cuò),輸入python -m ensurepip,python -m pip install --upgrade pip
4.再輸入pip install pandas進(jìn)行安裝
5.若依然安裝報(bào)錯(cuò),可采取方法二進(jìn)行安裝
方法二:找到pandas下載庫,然后通過pip install [pandas包路徑]安裝
1.進(jìn)入網(wǎng)站 https://www.lfd.uci.edu/~gohlke/pythonlibs/
Ctrl+F,輸入pandas,找到需要的版本下載即可。
比如我要下載的是pandas-1.4.3-cp310-cp310-win_amd64.whl。
下載后保存到磁盤某一個(gè)路徑下
2.打開cmd命令行,輸入pip install [pandas包路徑]文章來源:http://www.zghlxwxcb.cn/news/detail-779086.html
方法三:如果報(bào)超時(shí)的錯(cuò),是因?yàn)閲獾脑次募趪鴥?nèi)下載比較慢,可更換為國內(nèi)的鏡像。
使用清華大學(xué)的pandas鏡像進(jìn)行安裝:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
下載很快,且無報(bào)錯(cuò)。
最后執(zhí)行一下python -m pip list命令查看已經(jīng)安裝的包,可以看到不光pandas已經(jīng)裝好了,還安裝了numpy庫。文章來源地址http://www.zghlxwxcb.cn/news/detail-779086.html
到了這里,關(guān)于Python安裝Pandas庫的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!