Skip to content

Instantly share code, notes, and snippets.

@yoavram
Created November 22, 2016 07:02
Show Gist options
  • Save yoavram/fe7dc0fc457f2b92066b4512e0aea3bf to your computer and use it in GitHub Desktop.
Save yoavram/fe7dc0fc457f2b92066b4512e0aea3bf to your computer and use it in GitHub Desktop.
Install and run Python+NumPy using conda on DigitalOcean Ubuntu machines
# if you don't have a digitalocean account, use this link to create an account with $10 free credit: http://m.do.co/c/7a0c04ea8030
# create an Ubuntu droplet: https://cloud.digitalocean.com/droplets/new
# ssh to your new droplet; this is might be the hardest part so don't give up.
# install miniconda 3
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh
which python
# if previous command didn't show "/root/miniconda3/bin/python" then run the next command, otherwise skip it
export PATH="/root/miniconda3/bin:$PATH"
# install python-qt4 (required for matplotlib)
sudo apt-get install python-qt4
# configure and update conda
conda config --add channels conda-forge
conda update conda pip -y
# create and activate new environment
conda create -n MyEnv python=3.5 numpy matplotlib -y
source activate MyEnv
# if you need to install more packages, use conda and pip
# if you want to use a private github repo:
# create an ssh key for the droplet
ssh-keygen -t rsa -b 4096 -C "user@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat id_rsa.pub
# copy result of last command to github SSH keys: https://github.com/settings/keys
# clone your code to the droplet (replace "username" and "repo" with meaningful things)
git clone git@github.com:username/repo.git
cd repo/
# run your program
python simulation.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment