python - 在 requirements.txt 中强制重新安装 pip
问题描述
我有一个 requirements.txt 文件,其中有一些 git+ 参考。出于某种原因,我想总是重新安装这些,即使我进行了更改并修改版本并将其推送到我的 github 存储库,pip 说要求已经满足并且不安装。
这是我的 requirements.txt 文件的一部分:-
Django==1.10
git+https://github.com/myaccount/myrepo.git@master#egg=some_egg
我不想重新安装 requirements.txt 文件中的所有内容。只有 git+ 要求。
我试过这个: -
git+https://github.com/myaccount/myrepo.git@master#egg=some_egg --install-option="--upgrade --ignore-installed --force-reinstall"
但上述选项均无效。
解决方案
问题是你没有建议pip
你在 git 中有什么版本:
git+https://github.com/myaccount/myrepo.git@master#egg=some_egg
对于 VCS URLpip
不会查看 repo 以找出版本,它只查看 URL:
git+https://github.com/myaccount/myrepo.git@master#egg=some_egg-version
例子:
git+https://github.com/myaccount/myrepo.git@master#egg=package-1.0.8
当您将新版本推送到 Github 时,请requirements.txt
使用新版本更新您的版本并运行pip install -r requirements.txt -U
.
推荐阅读
- c - 为什么我在 c 中使用 strcat 时会出现此错误?
- json - 如何在 built_value 库中解析嵌套的 JSON
- python - NoReverseMatch at /posts/ Reverse for 'detail' with keyword arguments '{'id': 1}' not found. 尝试了 1 种模式:['posts/(?P
[^/]+)/$'] - r - R:仅填充接下来的两个 NA 值(按个人分组)
- c - C语言链表中的节点
- javascript - Chart.js 画布和图表宽度在重绘时被覆盖
- java - 从项目外部控制 recyclerView 项目对象
- java - 如何更改具有圆角半径的形状的背景?
- java - 我的 Spring Java 应用程序中的 Java 运行时错误
- mysql - 从弹性搜索和 MySQL 中加入数据以进行分页的最佳方法是什么?