Skip to content

Instantly share code, notes, and snippets.

@cellularmitosis

cellularmitosis/README.md

Last active May 31, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.