Skip to content

Instantly share code, notes, and snippets.

@PHPirates
Last active March 8, 2019 12:12
Show Gist options
  • Save PHPirates/6c0d75c8dad270bd34f5d7ee3bcc300c to your computer and use it in GitHub Desktop.
Save PHPirates/6c0d75c8dad270bd34f5d7ee3bcc300c to your computer and use it in GitHub Desktop.
How to update Python and projects with dependencies on Windows

Updating Python (This step Windows only)

  1. Install a new python version from https://www.python.org/downloads/windows/ the 64 bit web installer
  2. Make sure your PATH only contains the paths to the new version
  3. Delete the old python
  4. Restart your pc and test in cmd with python -V

Updating the basic Python packages

  1. Update global setuptools by running in cmd (sudo) python -m pip install -U setuptools. If this fails with a PermissionError, try pip install setuptools --upgrade --ignore-installed.
  2. Update global pip by running in cmd (sudo) easy_install -U pip and check with pip -V.

Updating project dependencies

  1. In project, in PyCharm open terminal and check venv is activated (it says (venv) in front of the line)
  2. Install the package pip-upgrader if needed, it updates all dependencies in requirements.txt
  3. You might have to remove the virtual environment and make a new one (inherit global packages).
  4. You may have to upgrade pip using the same command as before.
  5. Run pip-upgrade.

(Windows) To update the python behind the calculator button, edit HKLM/software/microsoft/windows/currentversion/explorer/appkey/18/ShellExecute in the registry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment