Installing Python components on a Mac

Hi All,

I am a Mac user and I have been told in one of the Stackoverflow discussion page that Homebrew is the best place for installing packages. The challenge here is that I hardly used any Terminal commands apart from the ones needed at work. Now that I am prepping to learn few things about Data Analytics, it requires me to setup my Mac with certain components. The following are the ones that needs to be installed on my Mac.

  1. Pandas
  2. Numpy
  3. Matplotlib
  4. Openpyxl
  5. Quandl

All of this on Python (3.7.2 or 3.7.3)

I am pretty sure the geeks over here will be able to help me out with this. I am really not sure in which sequence these components should be installed and also I am not sure about compatibility. Since the above components might come in different versions. I might need the exact versions and steps that is compatible with Python 3.7.x.

Hoping to fix this asap with all your inputs. Thanks in advance.

I would read over the documentation for ‘pip’ at the following official site.
pip - The Python Package Installer

Also, I would suggest using a virtual environment for your python project. Here are links to help you set it up which you will install your packages listed with ‘pip’ in the environment.
Python Packaging User Guide
The Hitchhiker’s Guide to Python

Thanks Robert. I tried installing Python, which worked. It looks like by default the python version is 2.7.10. Only when I type the command python3 --version, it is showing the version as 3.7.3. Not sure if this is an issue. Is there any way to make it run 3.7 by default?

Also I am running into the following issue when trying to install ‘pandas’. Not sure how to proceed on this. Please refer the following screenshot.


I have tried upgrading the pip, which did not work as well.

Please suggest.

You’re attempting to use the ‘pip’ which is distributed with your system and install to the system Library when you upgraded. I would have suggested to use python 3 which you could have installed the latest pip 19.0.3. If you’re determined to use the system python and libraries, then you may be able to bypass the permission error with the ‘–user’ switch. Are you sure that you read over the documentation in the links provided? You stated you wanted to use python 3 but everything you did was in reference to the system installed python 2. It even says “Consider using the ‘–user’ option or check the permissions.”

Example: ‘pip install {package name} --user’

If you’ve not altered the system python2, then install the brew distribution of python2 and pip install for that version. Or, just switch to the brew install of python3 and pip install for that distribution. Either way, I feel as though you’re not reading or understanding the material at the previously referenced links.

If you installed python via homebrew, then this will install python3. To use Python3’s pip you need to use pip3. Yes, I realize this naming convention may seem strange, but blame the Python folks!