How do I install Jupyter notebook on an Android device?
Asked Answered
P

3

62

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.

Piling answered 15/4, 2018 at 0:37 Comment(1)
Pydroid 3 app has a quick link for installing Jupyter. I haven't tried it yet, but reviews indicate that it works.Getup
P
44

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:

  1. Install the Termux app.
  2. 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
    
  3. Optionally, you can install some other useful packages that mesh well with Jupyter:

    $ LDFLAGS="-lm -lcompiler_rt" pip install numpy matplotlib
    
  4. 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:

enter image description here

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.

Piling answered 15/4, 2018 at 0:37 Comment(10)
apt command did not work, but the when I replaced that command with the pkg command , it did work. When you first invoke the termux and terminal, it will refer to the pkg command.Egad
However I could not install scipy like I could with the other answer: Directories to search for the sources can be specified in the numpy/distutils/site.cfg file (section [lapack_src]) or by setting the LAPACK_SRC environment variable. self.calc_info() NOT AVAILABLEEgad
Termux never fails to amaze me!Marinmarina
@Egad same as you here. In addition, pythin-dev, libzmq-dev, freetype-dev, libpng-dev , libcrypt-dev all gave "Package has no installation candidate" and then in LDFLAGS="-lm -lcompiler_rt" pip install jupyter got "No command 'pip' found"Hearth
FYI, I also needed to install cython in order to get matplotlib running, but otherwise it worked perfectly. I copied your method to do it: LDFLAGS="-lm -lcompiler_rt" pip install cythonMulloy
wiki.termux.com/wiki/No_more_-dev_packages no more dev packages are required with termux now.Prolongate
installing jupyter lab with just pip install jupyter-lab worked for me after thisEichmann
As far as I uderstand (not much, really) some packages need a special installation in termux, using its-pointless repo. So you first want to configure it (github.com/its-pointless/its-pointless.github.io) and then install scipy not ftom Python, but from the termux prompt : pkg install scipyBorrell
Even so, I had to install manually some packages that still complained (pyzlib and ccfi, I think ?) by using a plain pip install ccfi (without the LMFLAGS, and I do not have a clue why it worked...)Borrell
To achieve the whole build of jupyter in Termux I also had to install the following packages : rust and binutils (apt install rust binutils). Also, I had to use the Termux version provided by F-droid.Underpin
B
63

Download the app pydroid3. Open the app. On the top there is a 3-line button - click on it. There is a PIP option - click on it. In PIP, click on install and type jupyter. Once it gets downloaded, there is terminal option above pip, click on terminal and type jupyter notebook. Your work is done.

Edit

I got a video explaining the download of jupyter using pydroid3.

Brake answered 29/7, 2018 at 14:28 Comment(1)
I am getting error can u please help. error: ibb.co/bzDggB5Purvis
P
44

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:

  1. Install the Termux app.
  2. 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
    
  3. Optionally, you can install some other useful packages that mesh well with Jupyter:

    $ LDFLAGS="-lm -lcompiler_rt" pip install numpy matplotlib
    
  4. 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:

enter image description here

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.

Piling answered 15/4, 2018 at 0:37 Comment(10)
apt command did not work, but the when I replaced that command with the pkg command , it did work. When you first invoke the termux and terminal, it will refer to the pkg command.Egad
However I could not install scipy like I could with the other answer: Directories to search for the sources can be specified in the numpy/distutils/site.cfg file (section [lapack_src]) or by setting the LAPACK_SRC environment variable. self.calc_info() NOT AVAILABLEEgad
Termux never fails to amaze me!Marinmarina
@Egad same as you here. In addition, pythin-dev, libzmq-dev, freetype-dev, libpng-dev , libcrypt-dev all gave "Package has no installation candidate" and then in LDFLAGS="-lm -lcompiler_rt" pip install jupyter got "No command 'pip' found"Hearth
FYI, I also needed to install cython in order to get matplotlib running, but otherwise it worked perfectly. I copied your method to do it: LDFLAGS="-lm -lcompiler_rt" pip install cythonMulloy
wiki.termux.com/wiki/No_more_-dev_packages no more dev packages are required with termux now.Prolongate
installing jupyter lab with just pip install jupyter-lab worked for me after thisEichmann
As far as I uderstand (not much, really) some packages need a special installation in termux, using its-pointless repo. So you first want to configure it (github.com/its-pointless/its-pointless.github.io) and then install scipy not ftom Python, but from the termux prompt : pkg install scipyBorrell
Even so, I had to install manually some packages that still complained (pyzlib and ccfi, I think ?) by using a plain pip install ccfi (without the LMFLAGS, and I do not have a clue why it worked...)Borrell
To achieve the whole build of jupyter in Termux I also had to install the following packages : rust and binutils (apt install rust binutils). Also, I had to use the Termux version provided by F-droid.Underpin
N
8

I have tried the above instructions and everything works down to the tee except when the following command is run:

$ LDFLAGS="-lm -lcompiler_rt" pip install numpy matplotlib

This ends in an error that says that matplotlib could not be installed and the output advises you to install some dependencies.

My own output looks something like this:

Screenshot of Error

I googled and found that just installing a simple package through following command fixed it:

pkg install zlib-dev

after running this command run the following command again and both packages will be installed though it took a lot of time to complete:

$ LDFLAGS="-lm -lcompiler_rt" pip install numpy matplotlib

-cheers

Newhall answered 13/5, 2019 at 21:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.