TL;DR

  1. Phytonaut Mac Os Catalina
  2. Mac Os Python Ide

Quick walkthrough on how to install Virtualenv on Mac OS two different ways. This is an easy way to manage Python and it’s dependencies in your projects.

Python Releases for Mac OS X. Latest Python 3 Release - Python 3.4.0; Latest Python 2 Release - Stable Releases. Python 2.7.8 - July 2, 2014. Download Mac OS X 32-bit i386/PPC installer; Download Mac OS X 64-bit/32-bit installer; Python 2.7.7 - June 1, 2014. Python comes pre-installed on Mac OS X so it is easy to start using. However, to take advantage of the latest versions of Python, you will need to download and install newer versions alongside the system ones. The easiest way to do that is to install one of the binary installers for OS X from the Python Download page. Python 2 is bundled with Mac OS X. However, Python 3 is not. We recommend that you download and install Python 3, and use Python 3 exclusively when running programs associated with this booksite. Perform these steps to download and install Python, IDLE, Tkinter, NumPy, and PyGame.

Mac

Install Virtualenv with pipx

Install Virtualenv with pip

I just want to watch the video!

Why Virtualenv?

When working on multiple Python projects they will not always be running on the same version of Python. So a better way to manage the version of Python you are using is by creating a Virtual Environment.

Virtual Environments are isolated from the rest of your computer and are only responsible for each individual project’s Python version and the dependencies of your project.

Virtualenv is one of several tools that solves this problem.

Mac OS Python vs. Python3

Mac OS comes with a version of Python pre installed already usually 2.7.x or something of the like.

As Python2.7 is no longer supported by the maintainers of Python so going forward you are going to want to use some sort of Python3.

You can download the latest version of Python here.

You can find out which version you have by running the following command in your terminal.

When downloading Python3 this is distinguished by calling it just that, Python3.

Install Virtualenv on Mac OS

There are multiple ways to install Virtualenv so I will show a couple different ones.

How To Install Virtualenv with pipx

If you already have a Python 3.5+ interpreter the best is to use pipx to install virtualenv into an isolated environment. This has the added benefit that later you’ll be able to upgrade virtualenv without affecting other parts of the system.

Virtualenv Documentation

How To Install Virtualenv with pip

Alternatively you can install it within the global Python interpreter itself (perhaps as a user package via the –user flag). Be cautious if you are using a python install that is managed by your operating system or another package manager. pip might not coordinate with those tools, and may leave your system in an inconsistent state.

Virtualenv Documentation

Make sure when using this command you are specifying python3 and not just python

Virtualenv In Action

1. Create a new project folder

2. Setup virtual environment

3. Activate virtual environment

4. Check which version of Python you have running

It should be python3.7 or the like.

5. Deactivate the virtual environment

6. Check which version of Python you are running again. It should now say the old python2.7 version.

Summary

That’s it! That is a couple ways i have seen how to install Virtualenv on Mac OS.

I hope you found this walkthrough helpful!

How To Install Virtualenv on MAC OS Video Walkthrough

You can find the video for this and other Web Development tutorials at our Youtube Channel DeadbearCode!

Install Miniconda Python¶

There is a known issue with version 3.7 of Anaconda Python and certain versions of the Mac OSX operating system. We strongly recommend that you use python 3.6 on OSX to avoid any problems. To install python 3.6, please follow the steps below:

  1. To get started you need to download the OSX miniconda installer.

    1. Click on the link https: https://repo.continuum.io/miniconda/Miniconda3-4.5.4-MacOSX-x86_64.sh to download the Python 3.6 installer.

    2. Wait for it to download. It will place a file called Miniconda3-4.5.4-MacOSX-x86_64.sh in your downloads folder. On my computer using Safari this is ~/Downloads

  2. Open a Terminal window. If you don’t know how to do this click * Applications -> Utilities -> Terminal*

  3. Within the Terminal change directories into the folder where your downloaded file lives, i.e.

  4. Now run the bash “shell” program to install Miniconda

  5. Scroll through the license (press the space bar to move through quickly), type ‘yes’ to approve the terms, and then accept all the installation defaults.

  6. Close the Terminal program. Then, restart it.

  7. Within the Terminal type:

    1. Enter y at the Proceed prompt.

    2. When the installation completes, close the Terminal window.

Install Spyder IDE and Connect It to Miniconda Python¶

The second half of the installation is the Spyder IDE development environment. This is the software that you use to write, edit and test your Python programs. Spyder IDE calls Python to actually run the program. Spyder is included by default in the Anaconda Python distribution, which comes with everything you need to get started in an all-in-one package.

Phytonaut Mac Os Catalina

However, with Miniconda, we have to download and install Spyder IDE.

Mac Os Python Ide

  1. Go to the Terminal window.

  2. Type the following command:

    1. This will take some time to download.

    2. When the following prompt appears:

    3. Type y, and hit enter.

  3. Once the download is finished, type the following command to know the location of Spyder:

    It is usually installed in the bin folder within miniconda3

  4. To start Spyder, go to a terminal window and enter

Detecting 64-bits versus 32-bits Mac OS X Systems¶

You are running 64-bit Mac OS X.

Technically, all Apple computers purchased since Q4 2006 have been equipped with 64-bit capable processors. The Mac OS X operating system has supported 64-bit by default since OS X 10.6 Snow Leopard, released in 2009. The upgrade to the latest operating system for your computer is available for free, directly from Apple, since the release of OS X 10.9 Mavericks in 2013.