Ubuntu installs Jupyter and sets remote access

Source: Internet
Author: User
Tags sha1 jupyter jupyter notebook

Jupyter Notebook is a Web application that allows you to create and share documents that contain real-time code, equations, visualizations, and explanatory text.

The simple introduction is: Jupyter Notebook is an upgraded version of Ipython, and Ipython can be said to be an enhanced version of the interactive Shell, that is, it is more convenient than running Python in terminal, the interface is more friendly

Environment:

Ubuntu16.04 64-bit

1. Install Pip

(1) Update and upgrade packages

    sudo apt-get  update      sudo apt-get Upgrade  

(2) Install Pip

sudo apt-get Install PYTHON-PIP3  
2. Installing Jupyter

(1) Upgrade PIP3

sudo pip3 install--upgrade PIP3

(2) Installation Jupyter

sudo pip3 install Jupyter

Note that there must be sudo here. Otherwise the Jupyter installation will fail
Successful installation will display the following information

Note: If prompted

To run the command:

sudo pip3 install-vu setuptools

Install again

1. Generate a notebook configuration file

By default, the configuration file ~/.jupyter/jupyter_notebook_config.py does not exist and needs to be created by itself. Use the following command to generate the configuration file:

Jupyter Notebook--generate-config

If the root user executes the above command, a problem occurs:

 as root it is not recommended. Use the--allow-root to bypass.

The message is obvious, and the root user needs to add options when executing --allow-root .

Jupyter Notebook--generate-config--allow-config

After successful execution, the following information appears:

default config to:/root/.jupyter/jupyter_notebook_config.py
2. Generate Password Auto-generation

Starting with Jupyter notebook version 5.0, a command is provided to set the password: The jupyter notebook password generated password is stored in the jupyter_notebook_config.json .

$ jupyter Notebook passwordenter password:    ** */users/you/.jupyter/jupyter_notebook_config.json
Manually generated

In addition to using the commands provided, can also be manually installed, I am using the manual installation, because jupyter notebook password out of a bunch of content, no patience to see. Open Ipython to perform the following:

In [1 from notebook.auth import Passwdin [2]: passwd () Enter password:verify password:out[2'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed' 

sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aedThis string is the password to be jupyter_notebook_config.py added.

C.notebookapp.password = u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed  '
3. Modify the configuration file

jupyter_notebook_config.pyLocate the following line in, uncomment and modify.

c.notebookapp.ip='*' #163行  = u'sha:ce ... The cipher that was just copied '  #217行  ==8888 #可自行指定一个端口, use that port 228 row when accessing

After the above settings can be started on the server Jupyter notebook, jupyter notebook the root user to use jupyter notebook --allow-root . Open IP:指定的端口 and enter a password to access it.

It is important to note that Jupyter notebook cannot be started under the hidden directory (directories starting with.), otherwise the file will not be accessed properly.

Ubuntu installs Jupyter and sets remote access

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.