首页 > 解决方案 > How to update requirements?

问题描述

I would like to know how to update outdated requirements with the multi requirements files setup that cookie cutter uses (base, local, etc...) ?

If i launch a "pip freeze" it will write the requirements in a single file. It will not dispatch them in correct files

Do I miss something ?

标签: pythondjangocookiecutter-django

解决方案


您可以使用以下命令更新所有过时的 python 模块:

Linux:

pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U 

视窗(Powershell):

pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}

在此之后,您必须更新您requirements.txt的:

pip freeze > requirements.txt

如果您使用Pipenv

pipenv shell
pipenv update

推荐阅读