gpt4 book ai didi

python - pip force reinstall in requirements.txt

转载 作者:行者123 更新时间:2023-11-28 19:28:46 29 4
gpt4 key购买 nike

我有一个 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 URL pip不查看 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 .

关于python - pip force reinstall in requirements.txt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50616566/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com