Skip to content

Instantly share code, notes, and snippets.

@SHDShim
Last active April 2, 2018 16:30
Show Gist options
  • Save SHDShim/4f5987e4e1693b10dfa025baa9ab6f9d to your computer and use it in GitHub Desktop.
Save SHDShim/4f5987e4e1693b10dfa025baa9ab6f9d to your computer and use it in GitHub Desktop.
Local machine instruction for the COMPRES workshop attendees

How to install Anaconda, Jupyter notebook, and Pytheos (for the 2017 COMPRES workshop attendees)

(Important) Unlike your typical apps, most of the following procedures are all happening in terminal (osx) or command line (windows). So if you are not familiar with terminal or command line, please find a short instruction video on these in YouTube and watch it before you start the procedure below.

Install Anaconda

  • Download Anaconda from https://www.continuum.io/downloads for your OS. I recommend to download the graphical installer for Python v3.6.

  • Run the downloaded graphical installer. Do not change any default settings during installation. It is important to choose the Just me option for the install location of Anaconda. If you install for all users, you may experience some permission issues.

Terminal or Command line

OS X

  • Run terminal.app

  • In terminal, type:

$ source activate root
  • If anaconda is installed successfully you would see the following prompt.
(root) $

Windows

  • Run anaconda command line.

  • In command line window, type:

> activate root
  • If anaconda is installed successfully you would see the following prompt.
(root) >

Update conda

  • conda has many useful functions which makes python programming easier. It provides virtual environments where users can maintain multiples of different setups for python and module installations.

  • Update conda by:

(root) $ conda update conda

Update your modules

  • Update your modules in your environment.
(root) $ conda update --all

Setup the py35ds environment

  • I provide environment files in the pytheos github repository (https://github.com/SHDShim/pytheos): py35ds-mac.yml for mac and py35ds-win64.yml for windows. This environment files have a list of essential packages for running pytheos and other scientific calculations in Jupyter notebook.

  • Download a zipped file for the pytheos package by clicking the clone or download button (green at the top right in the pytheos github site).

  • Make a new folder to store python related files. In my example, I will assume that you made Python folder under your home folder.

  • Move the zip file to the Python folder and unzip the file.

  • In the terminal or command line, navigate to the pytheos-master folder under the Python folder.

  • Make sure the yml files exist in your folder (dir for windows and ls for osx).

  • Once you confirm the existence, run the following command for osx. This will create a new environment where you can run jupyter notebook and pytheos.

(root) $ conda env create -f py35ds-mac.yml
  • For windows,
(root) > conda env create -f py35ds-win64.yml
  • Once the environment is successfully created, switch to the new environment (osx):
(root) $ source activate py35ds
  • For windows:
(root) > activate py35ds
  • The command above will change the prompt to (osx):
(py35ds) $
  • For windows,
(py35ds) >

Run jupyter notebook

  • I recommand to run Jupyter notebook from your home folder. So first navigate to your home folder in the terminal (osx) or command line (windows).
(py35ds) $ jupyter notebook --browser chrome
  • This will open the chrome browser and show the navigator tab of the jupyter notebook.

  • Now you can go to the pytheos example folder and play with the example files.

How to finish jupyter notebook

  • Once you finish using jupyter notebook, in the terminal or command line, press control+c. This will quit the jupyter server.

If you have questions, please email Dan Shim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment