Python 2

  • macOS ships with Python already. But it is better not to mess with the system Python.
  • Because some system tools rely on it.
  • So we are going to install Python with Homebrew.

Installation

  • To install Python, type these in Terminal::
    brew install python
    

Virtualenv

  • Virtualenv is a tool to create isolated Python environments.
  • It is better to install Python packages in the project folder instead of installing them globally.
  • The advantage is that different projects may need different versions of packages.
  • To install Virtualenv, type:
    pip install virtualenv
    

Python 3

Installation

  • To install Python3, type these in Terminal::
    brew install python3
    

Virtualenv

  • Use pyvenv instead of Virtualenv
  • No extra installation is necessary as it comes with the installation of Python 3

results matching ""

    No results matching ""