Quickly update Python packages

Python is a good thing,Many times we like to use it to write small things... For example, many services on my server are written in Python ( Supervisor will use your Python program becomes Services ),Accumulate,Many dependency packages are actually used。

but,These Python dependencies will not follow your apt upgrade Update,Today, after a long time,I found a package I am using,Has been updated to 1.10.x,but me,Still using 0.4...

In short,Python's own package manager does not provide a convenient command like apt upgrade Update all packages with one click,We have to think of another way。

One-line command update method

Some articles on the Internet use a complex command to update,The principle is to read pip3 list --outdated (Ironically, pip gives a list of expired packages,But it doesn’t allow you to upgrade them with one click) and then input the result to pip3 install -The ,This scheme is not so stable,Maybe a master who is proficient in shell can use it freely.,I will not provide specific code,Because everyone’s realization is a little different。

Update using pip-review

Don't use the requirements below,Not easy to use,Use pip-review to set and select the dependent packages to be updated one by one,Then batch update,Convenient。

After installing pip-review,Use the following command to use:

use requirements

Is there a more simple and understandable update plan? The answer is yes。

The requirement file is used to solve the one-click configuration environment dependency of Python package distribution,We can also print out the global environment,Then import it in an updated form,Such,The global update is done!

First export global dependencies-that is, all installed packages。

Now we "install" these packages back,But to upgrade ……carry out!

Original article written by Gerber drop-off:R0uter's Blog » Quickly update Python packages

Reproduced Please keep the source and description link:https://www.logcg.com/archives/3466.html

By R0uter's Blog

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。


Leave a comment

Your email address will not be published. Required fields are marked *