如何使用pip更新/升级软件包? [英] How to update/upgrade a package using pip?

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

问题描述

使用pip更新软件包的方式是什么? 那些不起作用:

What is the way to update a package using pip? those do not work:

pip update
pip upgrade

我知道这是一个简单的问题,但由于它不是那么容易找到而需要(pip 文档不会弹出,并且来自堆栈溢出的其他问题是相关的,但不完全与此相关)

I know this is a simple question but it is needed as it is not so easy to find (pip documentation doesn't pop up and other questions from stack overflow are relevant but are not exactly about that)

推荐答案

方法是

sudo pip install [package_name] --upgrade

或简而言之

sudo pip install [package_name] -U

sudo将要求输入您的root密码以确认操作.

sudo will ask to enter your root password to confirm the action.

如果您没有root密码(如果您不是管理员),则应该使用 virtualenv ,然后应删除sudo:

If you do not have a root password (if you are not the admin) you should probably work with virtualenv and then you should drop the sudo:

pip install [package_name] --upgrade

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

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