Implementing a Python environment
on macOS, explained

Kevin Kupiec
Jul 20, 2017 · 19 min read

A guide for those with a non-technical background but with non-zero programming experience

My motivation

During the last six years, I have spent time as a management consultant, in corporate strategy, and leading growth and customer experience at a startup. In each of these roles, proficiency in data analytics was integral to my success, from building financial models in Excel to leveraging SQL and Python in support of analytical projects and reporting. But through all of this time, I never had the need to set up a system or troubleshoot difficult technical issues — let alone deploy code to production or build a database from scratch. To put it simply, I was skilled at extracting information from data but never had an understanding of how my analytics environment worked.

After having recently left my job, I decided it was time to close this knowledge gap and not only set up a programming environment for future personal projects but also invest the time to better understand how it works. From the very beginning, I was committed to absorbing as much information as possible, but I had no idea where to start, and so I started scouring the internet. Quickly, I found a multitude of guides outlining the steps required to set up an environment — which were never the same — but rarely did they discuss how it works or why certain choices were made. So, I did the obvious thing and decided to write my own, explaining each step in the process and justifying each decision made.

For this exercise, I decided to implement a Python environment because of its various use cases, ranging from app development to data analytics, both of which I’d like to explore in the future.¹ I wrote this guide as much for my future reference as for others, and I hope for this to be the first of many. Enjoy!

Note: I’m new to all of this and have written this guide by reading countless blogs, articles, documentation, forum posts, and Stack Overflow answers to piece it all together. Where possible, I have provided sources for the information I have used, and I recommend reading these if you have any questions. I don’t expect everything to be perfect. Questions, comments, and corrections are more than welcome!

A brief introduction

This is meant as a guide to setting up a Python environment on macOS Sierra (it should work on older versions of OS X) and assumes that the tools being used have not been previously installed. For those unfamiliar, a development environment is not a part of the language itself, it’s the base on top of which programming can be done and where code can be executed. Implementing an environment involves installing and configuring certain pieces of software to enable and streamline the development process.²

The environment implemented here includes the installation of a text editor (Atom), a package manager (Homebrew), Python 3, and several tools that help manage the environment when working across multiple projects. This guide stops here and does not touch on programming or software engineering topics. It’s divided into three sections followed by one appendix:

  • Getting started: Terminal and a text editor
  • Setting up Python using a package manager
  • Working with Python packages & virtual environments
  • Appendix: Summary of Steps

Each section is broken up to contain the following components:

  • Brief overview of the topics covered
  • In-depth discussion, including steps required to set up environment
  • Additional relevant resource for those looking to learn more

While this guide attempts to provide any necessary context for each step in the setup process, it may be valuable to supplement it with a brief Unix overview, as implementing a Python environment heavily relies on Unix and the command line.

Getting started: Terminal and a text editor

Terminal and a text editor are two essential tools for both setting up a Python environment and writing and executing code. This section briefly discusses the role of Terminal and introduces the idea of a shell — specifically bash — and a shell startup file. It concludes with a summary of text editors and the installation of Atom, the editor of choice in this guide.

The importance of Terminal

While everyone with even a limited amount of programming experience has encountered Terminal (which comes standard with macOS), there are a few specifics to note about its internal mechanisms the will help in understanding the Python environment. At its core, Terminal provides a command-line interface (CLI) for users (there are other programs that provide a CLI, but Terminal is used by default).³ The CLI exists as a means of interacting directly with the operating system by allowing a user to issue commands to the system through successive lines of text (command lines), either by individually entering them or by executing a file containing a series of them (a shell script).⁴ Commands vary greatly in their purpose, ranging from listing the files in a directory to installing and executing programs.

More specifically, launching Terminal opens a new window that is running a Unix shell session, which is what actually implements the CLI; it’s known as a shell because it’s the outer layer of the core of the computer’s operating system, the kernel.⁵ By default, Terminal uses bash, a type of Unix shell, and all commands executed in Terminal are therefore executed in the bash shell, using the associated language.⁶ Terminal and bash play an integral role in building and accessing the Python environment. Through a series of commands, they are used to install and manage necessary tools through the CLI. They will also continue to be the primary method to access the Python environment once built, all through a series of commands.

Shell startup scripts

When Terminal initializes a bash shell session, it looks for startup scripts — special shell scripts — to automatically execute. These serve as configuration scripts: they can contain environment variable declarations (variables that exist for the given process, e.g., the Terminal session) and commands to be executed at startup.⁷ They are critical when working in a development environment, as they export required variables and execute necessary commands to initialize the environment when a Terminal window is opened.

When a new shell session is initiated, bash will look for the following startup scripts in a hierarchical order, and stops after finding the first one:⁸

  1. ~/.bash_profile
  2. ~/.bash_login
  3. ~/.profile

Because of this, it’s important to maintain only one of these three files, and the obvious choice is ~/.bash_profile since it takes precedence over the others (and for this reason is used in this guide). It is important to note that many articles may advise adding commands to one of the other files, but these should ALWAYS be added to the same one. Otherwise, they will not be executed.

Whenever ~/.bash_profile is edited, the changes don’t automatically take effect in existing Terminal sessions, so it is helpful to source the updated file (execute the commands in the file) to implement the updates by running the following command in current sessions:⁹

$ source ~/.bash_profile

Note that the $ should not be typed as it marks the end of the prompt, which appears at the beginning of the command line and contains information such as the current user’s name and the current working directory.¹⁰

In addition to the login scripts above, there is one supplementary script that is often referenced in articles: ~/.bashrc. Unfortunately, this script is never automatically executed when a new Terminal is launched (Terminal launches an interactive login window, which looks for the above login sequence and not ~/.bashrc). Because of this, if an article recommends placing commands in this file and doesn’t have an explicit reason to do so, they should be placed in ~/.bash_profile instead. However, in case any commands must be placed in ~/.bashrc, it is helpful to add a command to ~/.bash_profile that sources ~/.bashrc to ensure any commands there are executed.¹¹

Installing and using a text editor

To open and edit ~/.bash_profile (and other files in the future), it is helpful to use a text editor, which is nothing more than a fancy plain text editor. With syntax highlighting and additional optional add-ons, their sole purpose is to help individuals code faster. This guide relies on Atom, one several great text editors out there.¹² It’s described as “A hackable text editor for the 21st Century” and can be downloaded for free from their website, atom.io.

One advantage of using a text editor is that files can be opened directly from Terminal. With Atom, this is done using the atom command, which is typically automatically made available when Atom is installed. However, if Atom isn’t able to install this itself (often due to needing an administrator password), the Atom menu bar will have show the option “Install Shell Commands” that installs it. Once available, using the command followed by one or more file paths opens those files in Atom (and creates them if they don’t already exist).¹³

Using Atom, it’s easy to update ~/.bash_profile to ensure ~/.bashrc is properly sourced. First, install Atom (and the shell commands if necessary), then run the following command in Terminal to open the startup script:

$ atom ~/.bash_profile

Once open, add the following lines to the ~/.bash_profile then save and source it:¹⁴

if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi

Additional resources

Setting up Python using a package manager

While macOS Sierra comes with a version of Python, an alternative distribution should be installed and used as part of the development environment. This section talks about different types of Python distributions available before going into detail about installing Python 3 with a package manager, specifically Homebrew.

Choosing a Python distribution

macOS Sierra comes with a Python distribution, but instead of using it for the development environment, it’s helpful to install a separate one. The pre-installed version — known as system Python — should be avoided because it is not always up-to-date (it’s Python 2) and because it makes it difficult to manage necessary changes and to the installation, often removing them when upgraded.¹⁵

Thus a new version of Python is needed for the environment, and there are a few installation options: through a fully built Python environment (e.g., Anaconda), via a macOS package manager (e.g., Homebrew), or directly from the Python website. Each of these implements a different Python distribution (a pre-built and pre-configured version of Python and a collection of Python packages), but at a very minimum they all install a Python interpreter. The interpreter can be thought of as the Python language equivalent to a Unix shell: it actually executes the code, either interactively one line at a time or by reading and executing code from a file.¹⁶

As a complete Python environment, Anaconda (or something similar) is by far the most fully featured of these distributions, providing the core Python language, 100+ pre-installed Python packages, and conda, a package & environment manager that makes it easy to install, manage, and update packages in the future.¹⁷ It makes setting up Python and keeping it up to date easy, and serves as a great Python environment for data analytics.¹⁸ On the other end of the spectrum, downloading a distribution directly from the Python website provides no additional features, packages, or environment management tools.

Implementing Python via a package manager lies somewhere in the middle of these two options. Package managers help with the installation and management Python in addition to a variety of common libraries and utilities not bundled with macOS. They help to identify a legitimate source for a piece of software, ensure that any dependencies required by that piece of software are installed, and then acquire, build, test, and install it (all with a single command).¹⁹ They also help to keep all of these files organized to avoid cluttering the rest of the system or interfering with other installed files.²⁰

Admittedly, package managers don’t provide as robust of a Python environment out of the box as something like Anaconda: they only come with a limited number of pre-installed Python packages and don’t provide an easy way to manage the Python development environment. But these are also their advantages as they provide increased flexibility to customize the environment depending on the type of development project.

For these reasons, this guide implements Python using a package manager. While there are several popular options available (Homebrew, MacPorts, & Fink being the most common three), with each having their pros and cons, Homebrew is the package manager of choice in this guide because it is easy to use, especially for someone setting up their first programming environment.²¹

Installing Homebrew, a macOS package manager

Installing Homebrew requires a GCC compiler, which is typical with many Unix-based tools. One does not come standard with macOS but can be installed as a part of Xcode Command Line Tools. These tools come as a part of Xcode (as of version 8), a large software suite of development tools & libraries available free from the Apple App Store.

To facilitate the installation of Homebrew, install Xcode from the App Store, launch the newly installed app, and accept the Apple license terms.²² Alternatively, instead of launching the app to accept the license terms, run the following command in Terminal and follow the prompts:²³

$ sudo xcodebuild -license

The downside of Xcode is that it is a large app — nearly 5GB of disk space — and, outside of the Command Line Tools, there is typically no need for any of its provided tools unless developing apps for an Apple operating system. Luckily, the much smaller Command Line Tools can be installed instead of the complete Xcode app by running the following command in Terminal:²⁴

$ xcode-select — install

However, if space is available, Xcode should be installed in its entirety as some Homebrew package installations require it.²⁵

With a GCC now available through Xcode, Homebrew can be installed; do so by executing the following command:²⁶

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

This will download the required files and explain what changes will be made; to begin installation, follow the prompt in Terminal.²⁷

Homebrew and the $PATH environment variable

Homebrew installs files locally instead of to system directories (i.e., /usr/local instead of /usr) to avoid clashes with system files and to keep them safe from being overwritten when updating system software.²⁸ Importantly, this means that when installing Homebrew packages, root access is never required, eliminating the possibility of modifying critical system files. Root access allows a user to add or modify files in the system directories. It is granted using the sudo command, and if Homebrew ever requires this command, it means something is broken.²⁹

Because of this, however, Homebrew ends up installing files in the local directory that may be similar to those already available in the system directories. Therefore, it’s necessary to ensure that the Homebrew installations take precedence over system versions (e.g., Homebrew Python instead of system Python), which is done by modifying the $PATH environment variable.³⁰ $PATH is a special variable that specifies a list of one or more directory names separated by colons. When a command is executed in Terminal, the system searches through $PATH, looking in each directory (from left to right) for the first filename that matches the command name, and executes that file.³¹

To make these changes, open ~/.bash_profile and add the following line to the top:³²

export PATH=/usr/local/bin:/usr/local/sbin:$PATH

When the startup script is executed, this command prepends both /usr/local/bin and /usr/local/sbin to the existing $PATH. The former of these is where the majority of Homebrew executable files are placed, but the latter is added for the rare case that Homebrew installs files there instead.³³ Note that some Homebrew installation guides will recommend editing /etc/paths instead of adding the above line to ~/.bash_profile, but this is not recommended as /etc/paths modifies the $PATH directory precedence system-wide, not just within Terminal.

Once completed, source ~/.bash_profile and confirm that the Homebrew installation was successful by running the following commands in Terminal:³⁴

$ source ~/.bash_profile
$ brew doctor

If there are no issues, the command will return “Your system is ready to brew”, but if there are errors, it will provide explanations and suggestions on how to fix them.

Implementing Python with Homebrew

Ready to brew, Python can finally be installed. But before actually doing so, there is one more important decision to be made: which version of Python to use. Python 3 is the present and future of the language, and without compatibility concerns and existing dependencies on Python 2, this guide implements Python 3 instead of 2.³⁵

Install Python 3 by running the following command in Terminal, which will take a few minutes to execute:

$ brew install python3

That’s it! This installation shows one of the principal benefits of using a macOS package manager.

At this point, both the system version of Python 2 and the Homebrew version of Python 3 are installed, and their interpreters can be launched interactively with the following lines of code, respectively:

$ python
$ python3

Note that if Python 2 were also installed using Homebrew, then the python command would instead open the Homebrew version instead of the system version due to the $PATH variable.³⁶

Additional resources

Working with Python packages & virtual environments

Packages are what make Python a powerful development environment, but they don’t come standard with a Homebrew Python installation. This section discusses pip, the go-to Python package manager, and how it can be used to install supplemental packages. It continues with an introduction to virtual environments, which can be used to keep the Python installation organized.

Pip, the recommended Python package manager

While Python is a great programming language on its own, it’s the multitude of available packages that make it a powerful development and analytics environment. Packages — collections of files, known as modules — provide additional functionality: some enhance the flexibility of the Python environment (development utilities) while others add functionality to the Python language (frameworks and libraries). While Python comes with The Python Standard Library (providing some powerful modules), other packages must be installed and managed separately from the core Python distribution.

Pip — a Python package itself — exists to help with this process, serving as a package manager exclusively for Python packages. It assists with installing, upgrading, configuring, and removing Python packages, similar to the support Homebrew provides for macOS software. While pip is not the only available option, it has become the recommended installer for Python packages. It was developed as an improvement to easy_install,³⁷ the most common alternative, and should be used in place of easy_install in all but a few circumstances.³⁸

Luckily, when Homebrew installs Python, it also installs pip (plus two other packages: setuptools and wheel), which can install additional packages using the following command, where pip3 is the alias for the pip version associated Python 3:³⁹

$ pip3 install some_package

By default, packages are installed in a special subdirectory called site-packages, the location the Python interpreter automatically searches when looking for packages to import and use.⁴⁰ A site-packages directory is associated with a specific installation of Python, which means that packages are only available within the Python version for which they have been installed, e.g., packages installed for Homebrew Python 3 are not available for system Python.⁴¹ Therefore, packages installed using pip3 will be installed to the Homebrew version of Python 3 and will be made globally available to its interpreter.

Note that many package installation guides will recommend using the sudo command to install Python packages using pip, but similar to the prior discussion, this is never required with a Homebrew version of Python since Homebrew installs Python locally (and therefore also Python packages). If sudo is ever required, that’s because something is broken in the Homebrew or Python installation.⁴²

Implementing virtual environments

While it’s helpful to install essential Python packages globally — those that are difficult to install, will be used across Python projects, or must be kept updated for security/stability reasons — doing so with all packages can quickly create a messy Python installation. Every new Python project requires a new set of packages or different versions of previously installed packages. If all of these are installed in the same location, keeping track of project dependencies becomes nearly impossible and the likelihood of unintentionally upgrading or removing a required package increases.

Virtual environments exist to help deal with these issues: they allow separate, optimized, independent Python environments to be created and managed individually. Packages can then be installed in a single environment, which makes the tracking of project dependencies straightforward.⁴³ There are several tools available for managing virtual environment, with the Python package virtualenv being the most popular. Note that the Standard Library for Python 3 comes with venv (or pvenv, its deprecated predecessor), a popular alternative to virtualenv. However, this guide uses virtualenv for one particular reason: venv is not compatible with Python 2, and to ensure future flexibility, virtualenv is used instead.⁴⁴

Virtualenv works by creating a new directory for each virtual environment. The directory contains all the elements required to execute a Python program — a copy of the Python binary (the executable file that starts the Python interpreter), a copy of the Standard Library, a site-packages directory that includes a copy of pip (plus setuptools and wheel) — but excludes other globally installed packages.⁴⁵

Once created, a virtual environment can then be used by activating it, which modifies $PATH such that the virtual environment appears first.⁴⁶ As a result, the Python interpreter for the activated virtual environment becomes the default interpreter, invoked with either the python or python3 commands. Additionally, packages installed in an active environment are added to its site-packages directory, inside the virtualenv directory, and are therefore only available to the Python interpreter in that virtual environment.⁴⁷

Install virtualenv via pip and test it by running the following commands in Terminal:

$ pip3 install virtualenv
$ virtualenv --version

Virtualenvwrapper, a compliment to virtualenv

Virtualenv provides the tools necessary to create virtual environments, but it doesn’t streamline managing them. For example, virtualenv creates new environments in whichever directory is currently active, and, because of this, virtual environments can end up being littered across the system. Another Python package, virtualenvwrapper, solves this problem by putting all virtual environments in one place while also providing a set of commands to make working with virtual environments generally more pleasant.

So before creating any virtual environments, install virtualenvwrapper with the following command:⁴⁸

$ pip3 install virtualenvwrapper

To finish setting up virtualenvwrapper, add the following lines to ~/.bash_profile:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Development
source /usr/local/bin/virtualenvwrapper.sh

The first two lines create environment variables used by virtualenvwrapper: $WORKON_HOME is the location virtual environments directories are created, and $PROJECT_HOME is where virtualenvwrapper creates new projects.⁴⁹ Both of these variables can be customized based on personal preference but also have default values if not defined in the startup script.⁵⁰ The last line sources a shell script that initializes some additional variables and functions required by virtualenvwrapper (if installed not following this guide, the file path may need to be updated).

By default, when Terminal is launched and the shell startup file is executed, virtualenvwrapper.sh finds the first python and virtualenv executables on the $PATH and remembers them to use later, and the version of Python found becomes the default version to be used in new virtual environments. But more importantly, this eliminates any conflict if the $PATH changes, and allows virtualenvwrapper to continue to function even when working in a virtual environment or other Python installation where virtualenv and virtualenvwrapper are not available.

However, instead of relying on virtualenvwrapper to set the python and virtualenv files based on the $PATH search, it is helpful to set two new environment variables that explicitly define the Python interpreter and full path of the virtualenv to use. Because virtualenvwrapper.sh depends on these variables, the commands must be placed before the file is sourced:⁵¹

export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh

Add these lines to the shell startup script and then source it.

It will also help to create the directories that will contain the virtual environments and new projects created by virtualenvwrapper. Run the following command to do so:⁵²

$ mkdir -p ~/Development ~/.virtualenvs

The basics of using virtual environments with virtualenvwrapper

Once installed, virtualenvwrapper is easy to use. To create a virtual environment, run the following:

$ mkvirtualenv some_project

This creates a virtual environment called some_project and a directory with the same name in $WORKON_HOME. Once created, run the following command to activate the virtual environment:

$ workon some_project

Once activated, the name of the virtual environment will now appear on the left of the prompt, e.g., (some_project)Your-Computer:some_project UserName$. Alternatively, mkproject can be used to create a project directory inside $PROJECT_HOME in addition to creating a virtual environment with the same name:

$ mkproject some_project

When a project and virtual environment are created in this way, using workon not only activates the virtual environment, it also sets the project directory as the active directory. Additionally, when workon is used to activate an environment, it will also deactivate any active environment, which makes it easy to switch between environments quickly.

To deactivate an environment, run the following command:

$ deactivate

And to delete a virtual environment:⁵³

$ rmvirtualenv my_project

By default, a new virtual environment will not have access to globally installed site packages, but this can be changed by creating it with the option --system-site-packages, e.g.:⁵⁴

$ mkvirtualenv my_project --system-site-packages

Additionally, when in an active virtual environment, access to the global site packages can be toggled on and off with the simple command below:⁵⁵

$ toggleglobalsitepackages

Additional resources

Appendix: Summary of Steps

Completing the below steps will implement the Python environment explained in this document. But note that these commands are not identical to those presented earlier in the guide due to the order in which they are completed. In particular, since ~/.bash_profile is not updated until the end, $PATH is updated with a command during the installation process.

  • Download & install Atom directly from their website, atom.io
  • Download & install Xcode from the App Store
  • Run the following commands in Terminal, following all prompts necessary:
$ sudo xcodebuild -license$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"$ export PATH=/usr/local/bin:/usr/local/sbin:$PATH$ brew install python3$ pip3 install virtualenv$ pip3 install virtualenvwrapper$ mkdir -p ~/Development ~/.virtualenvs
  • Open ~/.bash_profile by executing atom ~/.bash_profile in Terminal and add the below code before saving the file:
# set $PATH variable to ensure user-installed binaries take
# precedence
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
# set variables used for virtual environments and source
# virtualenvwrapper.sh
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Development
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
# load .bashrc if it exists
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi

References

1. https://www.codementor.io/codementorteam/beginner-programming-language-job-salary-community-7s26wmbm6

2. https://www.tutorialspoint.com/computer_programming/computer_programming_environment.htm

3. https://en.wikipedia.org/wiki/Terminal_(macOS)

4. https://en.wikipedia.org/wiki/Command-line_interface

5. https://en.wikipedia.org/wiki/Shell_(computing)

6. https://unix.stackexchange.com/questions/180943/terminal-vs-bash

7. https://www.quora.com/What-is-bash_profile-and-what-is-its-use

8. https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files

9. https://hackercodex.com/guide/mac-development-configuration/

10. http://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line

11. https://unix.stackexchange.com/questions/119627/why-are-interactive-shells-on-osx-login-shells-by-default

12. https://www.codementor.io/mattgoldspink/best-text-editor-atom-sublime-vim-visual-studio-code-du10872i7

13. http://flight-manual.atom.io/getting-started/sections/atom-basics/

14. https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files

15. https://github.com/MacPython/wiki/wiki/Which-Python

16. https://docs.python.org/3/tutorial/interpreter.html

17. https://docs.continuum.io/anaconda/

18. https://www.reddit.com/r/Python/comments/3t23vv/what_advantages_are_there_of_using_anaconda/

19. https://www.quora.com/What-is-the-purpose-of-Homebrew-package-installer-for-Mac-OS-X

20. https://apple.stackexchange.com/questions/32724/what-are-pros-and-cons-for-macports-fink-and-homebrew

21. http://tedwise.com/2010/08/28/homebrew-vs-macports

22. http://railsapps.github.io/xcode-command-line-tools.html

23. https://stackoverflow.com/questions/33560834/how-to-accept-xcode-license-in-a-automation-way

24. http://railsapps.github.io/xcode-command-line-tools.html

25. https://github.com/Homebrew/brew/issues/1613

26. https://brew.sh/

27. https://www.howtogeek.com/211541/homebrew-for-os-x-easily-installs-desktop-apps-and-terminal-utilities/

28. https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-filesystem-usr-local.html

29. https://superuser.com/questions/655113/understanding-homebrew-no-sudo-philosophy-and-questioning-faq

30. https://hackercodex.com/guide/mac-development-configuration/

31. https://en.wikipedia.org/wiki/PATH_(variable)

32. http://python-guide-pt-br.readthedocs.io/en/latest/starting/install3/osx/#install3-osx

33. https://apple.stackexchange.com/questions/62429/brew-path-didnt-cover-sbin

34. https://www.howtogeek.com/211541/homebrew-for-os-x-easily-installs-desktop-apps-and-terminal-utilities/

35. https://wiki.python.org/moin/Python2orPython3

36. http://python-guide-pt-br.readthedocs.io/en/latest/starting/install3/osx/#install3-osx

37. https://python-packaging-user-guide.readthedocs.io/discussions/pip-vs-easy-install/#pip-vs-easy-install

38. https://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install

39. https://github.com/Homebrew/homebrew-core/blob/master/Formula/python3.rb

40. https://stackoverflow.com/questions/31384639/what-is-pythons-site-packages-directory

41. https://hackercodex.com/guide/python-development-environment-on-mac-osx/

42. https://hackercodex.com/guide/python-development-environment-on-mac-osx/

43. http://blog.manbolo.com/2014/09/27/use-python-effectively-on-os-x

44. https://stackoverflow.com/questions/41573587/what-is-the-difference-between-venv-pyvenv-pyenv-virtualenv-virtualenvwrappe

45. https://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/

46. https://virtualenv.pypa.io/en/stable/userguide/

47. https://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/

48. http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/

49. http://brenda.moon.net.au/2015/08/20/getting-started-with-python-3-virtual-environments-on-os-x-yosemite/

50. https://stackoverflow.com/questions/6401951/using-different-versions-of-python-with-virtualenvwrapper

51. https://virtualenvwrapper.readthedocs.io/en/latest/install.html

52. http://brenda.moon.net.au/2015/08/20/getting-started-with-python-3-virtual-environments-on-os-x-yosemite/

53. https://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html

54. https://virtualenv.pypa.io/en/stable/reference/

55. https://virtualenvwrapper.readthedocs.io/en/latest/command_ref.html

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade