pip upgrades all packages with one click
What should you do when you have too many packages installed on your computer and haven’t upgraded for a long time? It’s too troublesome
to upgrade pip install --upgrade 包名称
one by one. Here’s a simple and quick way.
Set mirror source to speed up installation
Since the Python server is abroad, it is very slow to follow directly, and it is easy to fail the installation due to network reasons, so we generally set up a domestic mirror source. Here we recommend Tsinghua University, which synchronizes every 5 minutes, and the speed is absolutely online. The following command Both use cmd administrator mode to execute (win+R输入cmd CTRL+Enter)
, you can quickly open the administrator mode command prompt)
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Other commonly used domestic mirrors:
Tsinghua University: https://pypi.tuna.tsinghua.edu.cn/simple
Alibaba Cloud: http://mirrors.aliyun.com/pypi/simple/
University of Science and Technology of China https://pypi.mirrors .ustc.edu.cn/simple/
Huazhong University of Science and Technology: http://pypi.hustunique.com/Shandong
University of Technology: http://pypi.sdutlinux.org/Douban
: http://pypi.douban.com/simple /
upgrade pip
python -m pip install –upgrade pip
or
pip install -U pip
Download pip-review
One of the most popular highlights of Python is its many third-party libraries, and pip-review is a wheel that has been built by others. Its official introduction is as follows: is a convenience wrapper around pip. It can list available
pip-review
updates by deferring to pip list --outdated
. It can also automatically or interactively install available updates for you by deferring to pip install
.
It doesn’t matter if you don’t understand it, it’s fine if you know how to use it. To avoid permission issues and error reporting, it is recommended to run in administrator mode to
view installed packages and the latest version
pip-review
Upgrade all packages with one click
pip-review --auto
Upgrade all packages in batches, confirm before upgrading
pip-review --local --interactive
View updatable packages
It is recommended to check the updated ones first, and manually upgrade the packages that need to be upgraded separately
pip list --outdated --format=columns
or
pip list -o
Display information about a package
pip show [包名]
Upgrade a single package
pip install -U [包名]
Uninstall a single package
pip uninstall -y [包名]
pip search package|view installable package version
pip search
Disabled, need to install pip-search
package
pip install -y `pip-search
Instructions:
pip_search [包名]
#eg: pip_search numpy
pip view installable package version
pip index versions [包名]
# eg:pip index versions numpy