Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 2.47 KB

python_installation_instructions.md

File metadata and controls

27 lines (15 loc) · 2.47 KB

To install python....

  1. You don't need to install the python programming language, instead you want to install a package manager, conda. Conda manages all the software libraries for you. There are two flavors of conda that are widely used.

  2. Anaconda or Miniconda?

Miniconda. While Anaconda is great (it has a nice interface and quickly downloads 1500+ libraries that you can just click on to use). It takes up a lot of disk space on libraries that aren't especially relevant for ocean sciences. With Miniconda you install the libraries that you want, this makes it smaller, and also more controlled.

  • download the environment.yml file from here by scrolling down until you see the file and right clicking on it. Save it to your working directory. We will use this later. You can also choose to 'clone' (see green button in upper right corner) the entire directory with all the tutorials to your computer. This is useful if you want to work offline and save all your work.

  • Install Miniconda: Download Miniconda, Python 3.7 by clicking here. Install the downloaded file. Instructions for Mac.

Open up an anaconda prompt

  • Windows: From your start button, look for Anaconda, within that folder open 'Anaconda Prompt'. You are done, skip to next section on installing libraries.
  • macOS: Open Launchpad, then open Terminal or iTerm.
  • Linux–CentOS: Open Applications - System Tools - Terminal.
  • Linux–Ubuntu: Open the Dash by clicking the upper left Ubuntu icon, then type “terminal”.

In the anaconda window type conda list. If Anaconda is installed and working, this will display a list of installed packages and their versions.

Create a new environment and install software packages.

  • At your anaconda prompt, type conda env create -f environment.yml. You may need to include the directory the environment.yml file was downloaded to.

  • Once finished, let's open a Jupyter notebook, as a test. At the anaconda prompt type conda activate tutorialenv then type jupyter notebook. This will open a jupyter notebook in your browser. From there you can open notebooks and run them. It is probably easiest to navigate to where you keep your code, create a new 'python' directory and organize your code into projects from there. (This will also make using GitHub easier).