
The mkdir is a command used to create directory and using cd command we can open that directory, and that is exactly what we have done.

Go to the directory in which you want to create a new directory for python environment. I suggest, if you are starting up with python, create a new directory. Step 1:Ĭhoose a directory to put Python programming environment in, or create a new directory. Let's setup our very own virtual environment. We can setup as many python virtual environment as we want. Setting up virtual environment allows us to setup independent environment for different projects, with different dependencies. To setup virtual environment, we can use the venv module provided by Python 3.
HOW TO INSTALL PYTHON ON MAC OS HOW TO
$ brew update python3 How to Create a Virtual Environment To update the Python 3 installation, we can use Homebrew, To check the version of python installed, use the following command: Just like we do for Homebrew, but pip will install only python libraries and software packages within the python environment. Pip is used to install and manage libraries and packages that we want in our python development environment. It may take a few minutes as a lot of packages and dependencies are downloaded, you can see what Homebrew is doing on the screen logs.Īlongside Python 3, pip, setuptools and wheel will also be installed. This command will return a list of all the available packages for python, you will also see python3 and other latest versions on python in the list, and that is what we need. Step 1:Īs you can see in the Homebrew installation guide, you can search for available software packages using the brew search command. Considering that you have successfully setup Homebrew, let's start with Python 3 installation.

If you do not have Homebrew installed on your Mac, follow our Homebrew Installation Guide to set it up on your system. Homebrew is a software package manager which makes it very easy to install, update, cofigure and uninstall software packages required in OS X. To install Python 3.x we will be using Homebrew.
HOW TO INSTALL PYTHON ON MAC OS MAC OS
As the Mac OS wouldn't allow you to do so because it uses Python and cannot afford a change in it's version as that may lead to errors or failures at the OS level. Updating the Pre-installed Python 2.x in Mac OS

Every Python developer who uses Mac OS comes across the problem of whether to use the pre-installed python 2.7 on Mac or setup Python 3.x version, to start developing on the latest python version.Īlthough Python 2.x is still in use but only to support the already developed products, but if you are starting afresh then I would advice to choose Python 3.x, as sooner or later you will have to move to it, so why not today.
