Pip option to upgrade all Python packages

Asked 2 years ago, Updated 2 years ago, 99 views

I want to upgrade the package with pip at once What option should I use?

python pip

2022-09-22 22:35

2 Answers

There is no built-in flag for this feature yet. in lieu pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U Why don't you use


2022-09-22 22:35

It's also possible to create and execute Python code like this.

    import pip
    from subprocess import call

    for dist in pip.get_installed_distributions():
        call("pip install --upgrade " + dist.project_name, shell=True)


2022-09-22 22:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.