什么是第三方庫
別人寫好的一些功能代碼,我們可以拿過來直接用
第三方庫安裝方法
1、pip在線安裝(100%推薦)
默認源:pip install 包名 /更新包名:pip install -U 包名
國內源:pip install 包名 -i http://mirrors.aliyun.com/pypi/simple/
注意:報黃色警告不要管
備注:常用的國內源地址
(1)阿里雲 http://mirrors.aliyun.com/pypi/simple/
(2)豆瓣http://pypi.douban.com/simple/
(3)清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/
(5)華中科技大學http://pypi.hustunique.com/
注意:pip源提示“not a trusted or secure host” 解決
問題:
The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'. Could not find a version that satisfies the requirement proxy (from versions: ) No matching distribution found for proxy
答案:
http://mirrors.aliyun.com/pypi/simple/
改成
https://mirrors.aliyun.com/pypi/simple/
注意:pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='f 的解決辦法
pip --default-timeout=1000 install -U 模塊名
2、pycharm中安裝
3、離線安裝(了解即可)
1)下載地址:https://pypi.org/(百度pypi就有)
2)下載XX.tar.gz 壓縮包
3)對下載的安裝包解壓
4)把解壓后的文件copy到python的安裝路徑中
5)cmd進入到下載的文件夾中,會看到setup.py文件
6)執行命令:python setup.py install