我可以强制 pip 重新安装当前版本吗? [英] Can I force pip to reinstall the current version?

查看:71
本文介绍了我可以强制 pip 重新安装当前版本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到过当前版本的软件包似乎无法正常工作并需要重新安装的情况.但是 pip install -U 不会触及已经是最新的包.我看到了如何通过首先卸载(使用 pip uninstall)然后安装来强制重新安装,但是有没有办法在一个步骤中简单地强制更新"到名义上的当前版本?

I've come across situations where a current version of a package seems not to be working and requires reinstallation. But pip install -U won't touch a package that is already up-to-date. I see how to force a reinstallation by first uninstalling (with pip uninstall) and then installing, but is there a way to simply force an "update" to a nominally current version in a single step?

推荐答案

pip install --upgrade --force-reinstall <package>

升级时,重新安装所有软件包,即使它们已经是最新的.

When upgrading, reinstall all packages even if they are already up-to-date.

pip install -I <package>
pip install --ignore-installed <package>

忽略已安装的软件包(而是重新安装).

Ignore the installed packages (reinstalling instead).

这篇关于我可以强制 pip 重新安装当前版本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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