Home » Uncategorized » Install Python with two lines of code

Install Python with two lines of code

There are long discussions about which is the best or “right” way to install Python, but in case you just want to use it, here are the only two lines of code you need to enter in a terminal on your Mac to install a working Python environment with the latest Python 3.x including the packages numpy, scipy, astropy and iPython (among many other things).

  1. Install Homebrew:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install the latest Python 3.x and relevant packages:
    brew install python3

And that’s it. You can now start using Python by typing

ipython3

This will launch an interactive Python shell (which allows you to use tab-completion among many other neat things).

 

I am currently moving my social media presence from Twitter to Mastodon

My Tweets