Setting up a new Jupyter data exploration notebook
Been a month since I had to set up Jupyter for a new project. Here’s all the steps, which seems awfully complicated for a “standard setup”. Some of that is idiosyncratic to me though.
- newvenv
a shell alias I have. What it does:
python3 -m venv venv;
source venv/bin/activate;
pip install -U setuptools pip - pip3 install jupyter
- pip3 install matplotlib numpy pandas seaborn requests
these are standard visualization libraries, plus a sane HTTP client. Fortunately these install from precompiled wheel files so it’s quick - jupyter notebook --no-browser >> jupyter.log 2>&1 &
Jupyter really, really wants to be an interactive program. This sort of makes it headless. - ssh -L 8888:localhost:8888 my-server.example.com
I’ve installed and run Jupyter on a server. I run this command on my local development machine to forward the port to access it. - open http://localhost:8888/ in a browser
- %matplotlib inline
Be sure to run this as the first command in the notebook