python中的 pip 和 requirements.txt 是干什么的
生活随笔
收集整理的這篇文章主要介紹了
python中的 pip 和 requirements.txt 是干什么的
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
python中的pip是一個以Python計算機程序語言寫成的軟件包管理系統,他可以安裝和管理軟件包。
1、安裝第三方庫(軟件包):pip install 跟上包名,例如:pip install selenium
2、刪除第三方庫(軟件包):pip uninstall 跟上包名,例如:pip uninstall selenium
3、查看安裝的第三方庫:pip list
Python項目中必須包含一個 requirements.txt 文件,用來記錄項目所有的依賴包和版本號。以便新環境部署。
1、安裝requirement.txt:pip freeze>requirements.txt
2、一次性安裝requirements.txt里面所有的依賴包:pip install -r requirements.txt
3、安裝依賴包出現問題:說我pip版本低,需要更新版本。
4、移出pip并安裝最新版本pip:python -m pip install -U pip
5、查看pip版本:pip show pip
?
?
總結
以上是生活随笔為你收集整理的python中的 pip 和 requirements.txt 是干什么的的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: R语言(四) 自定义设置x轴时间刻度值
- 下一篇: 如何建立一个网站(我的5年经验谈)