python - 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 ?
解决方案
您可以使用以下命令更新所有过时的 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
推荐阅读
- android - 将变量从类传递给适配器
- javascript - moment.localeData().longDateFormat("L") 未根据区域设置返回正确的日期格式
- wordpress - 电影院网站 - Wordpress - 加入 Fandango 放映时间
- javascript - 无法在 JavaScript/Angular 中使用字符串 Polation 解析函数
- android - 当firebase中不存在变量时防止返回null
- c++ - 在 C++ 中,为什么我们必须在复制构造函数中传递用户定义的数据类型作为引用而不是在函数中,反之亦然?
- r - 在 R 中编写一个使用向量运算的函数,以便将其应用于向量
- spring-batch - Spring Batch - 如何将标题信息保存到 FlaFileItemReader 中的单个行对象中
- python - 如何再添加一个频道 ID,以便机器人对更多频道做出反应?
- python - 在 Tkinter 的文件夹中动态初始化 Frames