You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a pyenv plugin that allows you to update all packages of particular or all pyenv environments excluding system. It supports both conda- and pip-based environments. You can read more about the plugin and its implementation details in this article.
Usage
If you want to update all packages in all pyenv environments, execute the following command
$ pyenv pip-upgrade --all
However, more often we need to update packages of particular environments. This plugin allows updating packages of selected environments. For instance, the following command will update 3 environments 3.9.0, 3.9.0/envs/pyenv_test, and miniconda3-latest/envs/myenv:
By default, the packages of an environment are updated using one pip install --upgrade command, i.e., if, e.g., the cowsay and six packages need to be updated, the command to update them will be pip install --upgrade cowsay six. The new 2020 pip resolver will check dependencies of these packages, and if there are conflicts it will generate an error.
However, it is possible to run update packages sequentially using --sequentialpip-upgrade option. In this case, the packages will be updated one by one as in it is done in the original stackoverflow answer, and the most recently updated package will override conflicting dependencies.
The plugin supports autocompletion. Press <TAB> twice to see available choices.
Installation
In order to install the plugin you need at first install and configure pyenv. Then, just execute the following command from your terminal:
This command will clone the repository of plugin into the pyenv plugins directory. After this, pyenv will be also responsible for updating the plugin to the latest version if it appears.
Inspiration
The development of this plugin has been inspired by the following projects/articles:
pyenv-pip-update --- a pyenv plugin to update all environments at once
stackoverflow answer --- stackoverflow answer how to update all packages using pip