Remote Jupyter Notebook

Hi,

If you are working on Jupyter and need to access the notebook remotely during local development..You may need a simple access without certs, pwds...
Lets see how to do it..

One good link is below...

https://jupyter-notebook.readthedocs.io/en/stable/public_server.html.

If you don’t already have one, create a config file for the notebook using the following command line:
$ jupyter notebook --generate-config
In the ~/.jupyter directory, edit the notebook config file, jupyter_notebook_config.py. By default, the notebook config file has all fields commented out. The minimum set of configuration options that you should uncomment and edit in jupyter_notebook_config.py is the following:
# Set options for certfile, ip, password, and toggle off
# browser auto-opening
c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem'
c.NotebookApp.keyfile = u'/absolute/path/to/your/certificate/mykey.key'
# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:bcd259ccf...<your hashed password here>'
c.NotebookApp.open_browser = False

# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 9999
You can then start the notebook using the jupyter notebook command.
If you don't want to setup cert/key or need https.. u can simply use below
just uncomment and use c.NotebookApp.ip = '*' or just pass via command line.
In command prompt, use..
jupyter notebook --no-browser --NotebookApp.token='' --ip='*'
no browser or no security token is asked ..should listen from all ips for access.
Looks good.. Ideally it works.
If you face an issue like below error...
...site-packages/notebook/notebookapp.py", line 869, in _default_allow_remote
    addr = ipaddress.ip_address(self.ip)
  File "/usr/local/lib/python3.5/ipaddress.py", line 54, in ip_address

    address)
File "/usr/local/lib/python3.5/ipaddress.py", line 54, in ip_address
    address)
ValueError: '' does not appear to be an IPv4 or IPv6 address
....
Resolution: Instead of using * ... put  0.0.0.0
in etc/hosts file put ipaddress 0.0.0.0

jupyter notebook --no-browser --NotebookApp.token='' --ip='0.0.0.0'

Hope this helps...

--------------------------
For Anaconda
For jupyter notebook without token and browser, use

<Installed Path>\Anaconda3\Scripts\jupyter notebook --no-browser --NotebookApp.token=''


For a windows command window launch


cmd.exe /k " cd DIRPATH\Python && DIRPATHAnaconda3\Scripts\jupyter notebook --no-browser --NotebookApp.token='' "
Unix


jupyter notebook --no-browser --NotebookApp.token='' --ip='0.0.0.0'

Comments

Popular posts from this blog

ScoreCard Model using R

The auxService:mapreduce_shuffle does not exist

Zeppelin and Anaconda