python pip

  pip常用命令

install:安装软件
download:下载软件
uninstall:卸载软件
freeze:输出本地软件环境到文件中pip freeze > requirements.txt,可以在其他服务器通过pip install -r requirements.txt直接安装软件
list:列出当前系统中的安装包
show:查看安装包信息
check:检查安装包依赖信息
search:查找安装包
wheel:打包软件到whell格式
hash:计算安装包hash值
completion:生成命令补全
help:获取命令帮助

  pip使用豆瓣源加速安装软件包

pip install -i https://pypi.douban.com/simple/ django==1.11.11

  离线服务器部署软件包

#导出项目所需要的库文件目录
pip freeze > requirements.txt

#先将软件包下载到本地
pip install --download='目录' -r requirements.txt

#把安装包和目录清单上传到服务器

#从服务器安装,--no-index是防止库有依赖,不按照顺序安装
pip install --no-index -f file://目录 -r requirements.txt

 

  

posted @ 2019-10-21 22:06  ForLivetoLearn  阅读(115)  评论(0编辑  收藏  举报