Is there a way to install a functional instance of Jupyter notebook on an Android device? Specifically, I want to use Jupyter to run a Python notebook.
Advertisement
Answer
I found some information on the web (like in this blog post) while I was coming up with the answer for this question, but it was all at least somewhat wrong and/or out of date. Here’s a complete set of working instructions:
- Install the Termux app.
Open Termux, then enter/run the following commands in the prompt:
$ apt install clang python fftw libzmq freetype libpng pkg-config libcrypt $ LDFLAGS="-lm -lcompiler_rt" pip install jupyter
Optionally, you can install some other useful packages that mesh well with Jupyter:
$ LDFLAGS="-lm -lcompiler_rt" pip install numpy matplotlib
Finally, test the notebook out by running:
$ jupyter notebook
When you run jupyter notebook
, a notebook server starts up and dumps some information to stdout. When you see the line:
Copy/paste this URL into your browser when you connect for the first time, to login with a token:
copy the following URL, paste it into the browser on your device, and then hit go. You should end up with something that looks like this:
I tested these instructions out a Nexus 7 2013 (wifi) running stock Android 6.0.1 (Marshmallow).
Update: <foo>-dev
packages dropped in Termux
As @OmPS pointed out in the comments, Termux dropped all of it’s <foo>-dev
packages. I’ve updated step 2. above to match, but I haven’t tested it out since I no longer have access to my android device. If someone could please test the current version of the instructions above and then post their experience in the comments, that would be very helpful.