Python2 Default Setup on Mac
Default MacOS comes with latest Python 2.7. It will be pre-installed along with some pyobjc packages as well.
If you'd like to play around with python and external packages, it's best not to touch the original Python install from the System. Unfortunately, this Python (version 2.7) comes with neither pip nor virtualenv packages to help setup a separate environment!
sudo python get-pip.py
sudo /usr/local/bin/pip install virtualenv
Setup a Python2 virtual environment in a separate directory:
python -m virtualenv mypy source mypy/bin/activate python -c 'import sys; print sys.path'
You should able to verify with the output above that you are indeed using your own setup of an isolated Python2 environment, and it even has your own pip installed list, so you won't mess up the system's version of Python2!
OSX comes with 2.7, but not Python3. You can download the latest Python3 from python.org site and install it. It will give you the new ' python3' command, which will not conflict with your existing Python2. But if you want to use
python commands for Python3 for your development activities, then I suggest you create a new virtual environment of your own. The Python3 install should come with a
pyvenv command. For example:
pyvenv mypy3 source mypy3/bin/activate python -c 'import sys; print(sys.path)'