简体   繁体   English

如何重新安装Requirements.txt

[英]How to reinstall requirements.txt

I'm working in this shared Django project, a colleague is the owner of the repo in Github. 我正在这个共享的Django项目中工作,一位同事是Github中仓库的所有者。 The problem I am facing right now is that he added raven to his packages and in github the requirements.txt file is updated, however when I tried with git pull, locally, my requirements.txt does not have raven added. 我现在面临的问题是他在自己的软件包中添加了raven ,并在github中更新了requirements.txt文件,但是当我在本地尝试git pull时,我的requirements.txt没有添加raven He told me that I have to reinstall requirements.txt so I tried with pip freeze > requirements.txt but nothing change. 他告诉我,我必须重新安装requirements.txt,所以我尝试了pip Frozen> requirements.txt,但没有任何更改。

How can I update my requirements.txt file according the updates made from Github? 如何根据Github进行的更新来更新我的requirements.txt文件?

After you've pulled the latest changes into your requirements.txt, you can absolutely rerun pip. 在将最新的更改添加到requirements.txt中之后,您可以绝对重新运行pip。 Run the command with pip install -r requirements.txt and it will install any new modules. 使用pip install -r requirements.txt运行命令,它将安装所有新模块。

You need to pull all changes to your local repository. 您需要将所有更改拉到本地存储库。 To do that, you need to make sure that your git repository don't have any active changes. 为此,您需要确保您的git存储库没有任何活动更改。

git commit -am "changes"
git pull
pip install -r requirements.txt

确保requirements.txt不在.gitignore文件中,这将阻止它被更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM