如何使用pip和需求文件升级特定的包? [英] How can I upgrade specific packages using pip and a requirements file?

查看:133
本文介绍了如何使用pip和需求文件升级特定的包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Django项目中使用了一个需要文件的pip,在virtualenv中。我正在尝试升级一些软件包,特别是Django本身,我收到一个关于源代码冲突的错误:

 源在`< virtualenv`> / build / Django中,版本1.2.3与Django == 1.2.4(从-r要求/ apps.txt(第3行))冲突

将需求文件中的Django版本号从1.2.3更新为1.2.4。我正在使用这个命令实际进行升级:

  pip --install --upgrade -E`< virtualenv dir `> - 要求`< requirements file`> 

我找不到任何触发整个软件包重新下载的标志。我甚至尝试先运行卸载命令,然后安装,但没有骰子。也许我错过了什么?

解决方案

我不知道这是否是你的问题,但在我的情况下,不能将Django升级到1.2.4 - 我总是用1.2.3版本完成,所以我卸载了Django:

 < virtualenv> / bin / pip卸载Django 

然后我删除了 ; virtualenv> / build / Django 目录,最后我安装了正确的版本:

  virtualenv> / bin / pip安装Django 

希望这将有所帮助。


I'm using pip with a requirements file, in a virtualenv, for my Django projects. I'm trying to upgrade some packages, notably Django itself, and I'm getting an error about source code conflicts:

Source in `<virtualenv`>/build/Django has version 1.2.3 that conflicts with Django==1.2.4 (from -r requirements/apps.txt (line 3))

That's after updating the version number of Django from 1.2.3 to 1.2.4 in my requirements file. I'm using this command to actually do the upgrade:

pip --install --upgrade -E `<virtualenv dir`> --requirement `<requirements file`>

I can't find any flag that triggers a total package re-download. I even tried running an uninstall command first, then the install but no dice. Maybe I'm missing something?

解决方案

I'm not sure if it's exactly your problem, but in my case, I wasn't able to upgrade Django to 1.2.4 - I was always finishing with 1.2.3 version, so I uninstalled Django with:

<virtualenv>/bin/pip uninstall Django

Then I removed <virtualenv>/build/Django directory and finally I installed the proper version with:

<virtualenv>/bin/pip install Django

Hope this will help.

这篇关于如何使用pip和需求文件升级特定的包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆