Skip to content

Instantly share code, notes, and snippets.

@karlaking
Last active April 4, 2018 22:40
Show Gist options
  • Save karlaking/cf71b3f3704a69a7ef304db8267091ec to your computer and use it in GitHub Desktop.
Save karlaking/cf71b3f3704a69a7ef304db8267091ec to your computer and use it in GitHub Desktop.

How I set up my Descartes Labs Development Environment

These instructions cover installing a Python 3 + Jupyter Notebook + Descartes Labs stack on a clean Mac High Sierra OS X system. There are a few optional applications noted that are fun, but not necessary to get the stack running. I use Anaconda/conda for package management & installation.

General developer installations

Install xcode via the appstore & accept the license agreement via command line

sudo xcodebuild -license

Configure git command line

git config --global user.email "xx@gmail.com"
git config --global user.name "xx"

Install homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install my preferred terminal http://iterm2.com/ & http://ohmyz.sh/ (optional)

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Install spectacle (optional window resizing tool)

https://www.spectacleapp.com/


Setting up Python and Anaconda

Install Python 3

brew install python3

Install and authenticate the descartes labs platform via pip

pip3 install descarteslabs
descarteslabs auth login

Download & install Anaconda for Python 3.6, this will take up 2.05 GB of space

https://www.anaconda.com/download/#download

~~If you've updated your terminal, you may have to connect terminal to anaconda, giving you access to conda ~~

In your terminal, test if this necessary by typing conda. If it isn't recognized, do the following. export PATH="/Users/<your user location>/anaconda3/bin:$PATH"


~~Create a virtual environment and install analytical libraries ~~

More on managing conda packages here:

https://conda.io/docs/user-guide/tasks/manage-environments.html

Create a virtual environment & activate it

conda create --name <virtual env name>
source activate <virtual env name>

Install descartes labs platform on your virtial environment

conda install -c conda-forge -n <virtual env name> descarteslabs

~~Deactivate the environment ~~

deactivate <virtual env name>

Install Jupyter Notebooks & GDAL on the virtual environment you've created

Launch the Anaconda Navigator
Select the Environments tab, then select your virtual environment to see the packages installed
Select "Not installed" from the drop down, and search for GDAL & click the box to install GDAL 2.X.X. This will take a moment.

Go back to the homepage & select your virtual environment from the "Applications on" drop down to gain access to your virtual environment.
Install jupyter notebook on the virtual environment via the Anaconda Navigator.

Update - The alpha version does not support Python3 and there is an alpha installation.

These instructions walk through how to install the alpha and Jupyter Notebooks for an environment. They should probably be adapted to use a virtual environment.

Install python 2.7 and and pip (I think I used brew, but cannot recall.)

Install Jupyter Notebooks

Via pip, run: pip install --user jupyter notebook

Add the user to your ~/.bashrc.
export PATH="$HOME/Library/Python/2.7/bin:$PATH"

Install and authenticate the descartes labs platform via pip

Install nightly Alpha using pip. The latest client packages can be found here: https://docs.descarteslabs.com/docs/installation.html#alpha-installation

Install GDAL

pip install --user GDAL

Install SK Image & SK Learn

pip install --user scikit-learn```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment