Skip to content

Instantly share code, notes, and snippets.

@cellularmitosis
Last active May 31, 2020 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cellularmitosis/8a40dc76c100c0f99700b9636bf09d62 to your computer and use it in GitHub Desktop.
Save cellularmitosis/8a40dc76c100c0f99700b9636bf09d62 to your computer and use it in GitHub Desktop.
Installing Python 2 and 3 on various systems

Blog 2020/5/1

<- previous | index | next ->

Installing Python 2 and 3 on various systems

Reminder to self about how to install and invoke Python 2 vs. 3 on the various platforms I use.

See also https://xkcd.com/1987


Summary: What do I get when I type ____?

Platform python / pip python2 / pip2 python3 / pip3
MacOS (Mojave) / Homebrew 2.x 2.x 3.x
Debian (Buster) 2.x 2.x 3.x
Windows (7) / MSYS2 3.x 2.x 3.x

MacOS (Mojave) / Homebrew:

Note: this assumes /usr/local/bin precedes /usr/bin in your $PATH.

Python 3.x:

brew install python

Invoke as python3 and pip3.

Python 2.x:

This is a bit of a pain.

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/86a44a0a552c673a05f11018459c9f5faae3becc/Formula/python@2.rb

Invoke as python and pip (or python2 and pip2).


Debian (Buster):

Python 3.x:

apt-get install python3 python3-pip

Invoke as python3 and pip3.

Python 2.x:

apt-get install python python-pip

Invoke as python and pip (or python2 and pip2).


Windows (7) / MSYS2:

Python 3.x:

pacman -S python python-pip

Invoke as python and pip (or python3 and pip3).

Python 2.x:

pacman -S python2 python2-pip

Invoke as python2 and pip2.

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