Fork me on GitHub

Project Notes

Installing Python 2 and 3 on MacOSX

Notes on installing and maintaining python 2 and 3 versions on MacOSX.

:arrow_forward: return to the Catalog

Notes

Homebrew

I’m using brew to install and upgrade system versions of python.

brew install python
brew install python3

Currently, the default python in my system is 2.7:

$ python --version
Python 2.7.16
$ which python
/usr/local/bin/python
$ which python3
/usr/local/bin/python3

Using VirtualEnv

To install virtualenv, it is now recommended to use pip user packages:

pip install --user virtualenv

NB: previously (and I think what I originally used on my machine) was to use easy_install sudo easy_install virtualenv.

Creating a python 3 virtual environment

$ virtualenv -p python3 venv3
$ source venv3/bin/activate
(venv3) $ python --version
Python 3.7.4
(venv3) $ deactivate
$

Creating a python 2 virtual environment

$ virtualenv venv
$ source venv/bin/activate
(venv) $ python --version
Python 2.7.16
(venv) $ deactivate
$

Credits and References

About LCK#87 python
Project Source on GitHub Return to the Project Catalog

This page is a web-friendly rendering of my project notes shared in the LittleCodingKata GitHub repository.

LittleCodingKata is my collection of programming exercises, research and code toys broadly spanning things that relate to programming and software development (languages, frameworks and tools).

These range from the trivial to the complex and serious. Many are inspired by existing work and I'll note credits and references where applicable. The focus is quite scattered, as I variously work on things new and important in the moment, or go back to revisit things from the past.

This is primarily a personal collection for my own edification and learning, but anyone who stumbles by is welcome to borrow, steal or reference the work here. And if you spot errors or issues I'd really appreciate some feedback - create an issue, send me an email or even send a pull-request.