Data Science Env
This is the quickest way to get started with Jupyter Notebooks for Practical Data Science. We use Vagrant to configure a virtual machine that can be run on all operating systems.
To get started with this:
- download the contents of this repository and put it somewhere on your computer.
- (if on Windows) install PuTTY. You need it to be in your
%PATH%, so use the installer.
- install Vagrant
- (if on Windows) run
vagrant plugin install vagrant-multi-puttyin any directory to install the PuTTY plugin.
- install VirtualBox
- open terminal/CMD in the same directory as the Vagrantfile and run the command
- you will see the virtual machine boot up. This takes ~3 minutes on my laptop. Once you see the prompt
ubuntu-disco login:, minimize the virtual machine window.
- in the original terminal/CMD window, run the command
vagrant puttyon Windows) to connect to the virtual machine.
- you should get a bash shell.
cd assignmentsto get to the folder that is automatically synced to the
Great! You have a supported environment set up and ready.
- copy the handout to the
- navigate to the folder with
cdand list files with
lsto make sure the file is there.
- extract the handout with
tar -xv -C hw1_get_started -f hw1_get_started.tgz. To see what this command does, you can use this website.
- install additional pip requirements for some homeworks. To do that, run
pip3 install -r requirements.txt. (Update: you no longer need to run
sudo pip ..., it continues to be a Very Bad Idea.)
- start the Jupyter Notebook with
python3 -m jupyter notebook. If you get the error
Exception: Jupyter command ``jupyter-notebook`` not found., then log out (with Ctrl+D) and log back in (with
- Copy the URL displayed and paste it into your favorite web browser. Jupyter Notebook should load.
To shut down the VM, run
vagrant halt on your machine.
If you are on OSX, you may not see an
assignments folder. The quickest way to get started is to use the built-in upload and download features:
- Create a new folder called something other than assignments, for example with
python3 -m jupyter notebook hw1
- Open the Jupyter Notebook link in your browser
- Use the Jupyter Notebook upload feature to upload data into the VM. You can upload
.tgzfiles and untar them using the terminal.
- Download your completed Jupyter Notebook for submission by opening the notebook and using File > Download as > IPython Notebook.
If you are upgrading environment versions, you may need to reset the VM. To do that:
vagrant haltto stop the running virtual machine
vagrant destroyto delete the current virtual machine (and keep the assignments folder)
- download and replace the previous
datascienceenvfolder (make sure you save your work elsewhere!)