Installing Python

Our preferred way to install python on our windows machines is via pyenv

open a powershell and copy paste

Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"

reopen the powershell and use the follwing command to install different python versions and set one of them as the global default:

  1. Run pyenv version to check if the installation was successful.
  2. Run pyenv install -l to check a list of Python versions supported by pyenv-win
  3. Run pyenv install <version> to install the supported version
  4. Run pyenv global <version> to set a Python version as the global version

To set a python version as the local version (it needs to be already installed) within a folder (usefull for creating a (Python - venv) ): pyenv local <version>

   commands     List all available pyenv commands
   local        Set or show the local application-specific Python version
   latest       Print the latest installed or known version with the given prefix
   global       Set or show the global Python version
   shell        Set or show the shell-specific Python version
   install      Install 1 or more versions of Python
   uninstall    Uninstall 1 or more versions of Python
   update       Update the cached version DB
   rehash       Rehash pyenv shims (run this after switching Python versions)
   vname        Show the current Python version
   version      Show the current Python version and its origin
   version-name Show the current Python version
   versions     List all Python versions available to pyenv
   exec         Runs an executable by first preparing PATH so that the selected 
                Python version's `bin' directory is at the front
   which        Display the full path to an executable
   whence       List all Python versions that contain the given executable

Last updated bymartin froehlich