Managing Python versions

pyenv

  • Simple Python Version Management
  • It belongs to the same project as the third-party package management tool Pyenv-VirtualEnv
  • It is recommended to use the pyenv-win branch for Windows
  • Making the url: https://github.com/pyenv/pyenv

alternatives

  • Alternatives on Linux can be switched to the default version (not just to Python)
  • Ubuntu-18.04 Switch between Python2 and Python3

Manage third party package versions

pyenv-virtualenv

  • a pyenv plugin to manage virtualenv (a.k.a. python-virtualenv)
  • It belongs to the same project as Pyenv, the Python version management tool
  • Making the url: https://github.com/pyenv/pyenv-virtualenv

virtualenv

  • A tool for creating isolated ‘virtual’ python environments.
  • Documents: https://virtualenv.pypa.io/en/latest/

    VirtualEnv is a tool for creating isolated Python environments. As of Python 3.3, a subset of it has been integrated into the standard library under the venv module. Note, however, that the venv module does not provide all of the library’s capabilities (for example, the inability to create boot scripts, the inability to create virtual environments for versions of Python other than the host Python, non-relocatable, and so on). In general, such tools still prefer to use VirtualEnv because it is easy to upgrade (via PIP), handles different Python versions uniformly, and some more advanced features.

  • VirtualEnv is a tool produced by PyPA (the Python Packaging Working Group)
  • Making the url: https://github.com/pypa/virtualenv

Venv (pyvenv)

  • The venv virtual environment module has been part of the standard library since version 3.3 of Python.
  • PyVenv is the recommended tool for creating virtual environments in Python 3.3 and 3.4. Python 3.5 recommends using Venv for creating virtual environments. PyVenv was deprecated in Python 3.6.
  • The library url: https://docs.python.org/zh-cn/3/library/venv.html
  • Tutorial url: https://docs.python.org/zh-cn/3/tutorial/venv.html

pipenv

  • Pipenv is a Python dependency management tool released by Kenneth Reitz in January 2017 and now maintained by PyPA. You can think of it as a combination of Pip and VirtualEnv, and it’s based on Pipfile to replace the old dependency logging method (requires.txt).
  • Li Hui said Pipenv is a pit: don’t use Pipenv

pipx

  • Install Python tools that execute directly in the virtual environment
  • Pipx compared with other tools: https://pypa.github.io/pipx/comparisons/

poetry

  • Better package management tools than PIP and pipenv
  • Used in conjunction with PIPX

    pip install pipx
    pipx install poetry
    poetry about

This article from the
qbit snap