Pipenv的使用

命令格式:COMMAND [ARGS]

Commands:
  check          针对PEP 508检查安全漏洞
  clean          卸载所有不在Pipfile.lock中表明的包
  graph         树形展示当前虚拟环境中,各个已安装包的依赖关系
  install       安装软件并添加到Pipfile文件中,或者从Pipfile文件中安装所有
  lock          生成Pipfile.lock文件
  open           在编辑器中查看一个库
  run           在虚拟环境中运行命令
  shell         使用虚拟环境,生成一个shell
  sync          安装Pipfile.lock中表明的所有包
  uninstall       卸载软件包并从Pipfile文件中删除
  update         Runs lock, then sync.

切换国内源:编辑Pipfile文件,修改[[source]]下的url参数,其他不需要修改

阿里云                http://mirrors.aliyun.com/pypi/simple/
豆瓣                  http://pypi.douban.com/simple/
清华大学              https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学    https://pypi.mirrors.ustc.edu.cn/simple/

其他

  1. 导入requirements.txt
    pipenv install -r path/to/requirements.txt
  2. 导出requirements.txt
    pipenv lock -r [-d]
  3. pipenv的坑
    pipenv install命令会更新所有的软件包,会导致依赖报错;
    解决版本:在Pipfile文件中锁定版本,或者安装时指定版本pipenv install requests==2.13.0

猜你喜欢

转载自www.cnblogs.com/dream08/p/12903112.html