Installing Python and numpy on Mac/Windows/Linux
So you're working on the Gravitational Fields chapter and you've reached the Python
projects.
Don't have Python
?
Don't have numpy
?
Don't worry. Here we've collected some resources on how to install these on your system and get to work.
Windows
If you're on Windows, the fastest way to get Python up and running is to download Anaconda. You'll get numpy
, scipy
, pandas
(and a set of other very useful scientific packages) installed on your system and automatically added to your PATH
.
Download the installer and follow the instructions on the install page.
After the install is complete, open the command prompt and type jupyter notebook
on the terminal line.
Jupyter Notebook is an interactive Python command shell. Opening a new notebook will allow you to edit and execute Python scripts.here.
You can find Jupyter documentationMacOS
Checking your system
If you're on MacOS, you can search for "Terminal" in Spotlight or in your Applications folder.
Open it up, type ls
and hit return. You'll see something like this:
Python
comes pre-installed on MacOS, and so if you type python
and hit return, you'll enter the Python interpreter where you can test commands on the fly.
Installing numpy etc.
The easiest way to obtain numpy
is via the Anacondas distribution.
If you go here and follow the instructions at Anaconda for MacOS, you'll get numpy
, scipy
, pandas
(and a set of other very useful scientific packages) installed on your system and automatically added to your PATH
.
Once the install is complete, open up a Terminal window and enter jupyter notebook
in order to open the interactive Python command shell (see the Windows install section for details).
Linux
If you're on a Linux distribution, the fastest way to get Python up and running is to install Anaconda.
Download the installer, then follow the instructions on the install page.
Once the install is complete, open up a Terminal window and enter jupyter notebook
in order to open the interactive Python command shell (see the Windows install section for details).