Ubuntu installation of Jupyter Notebook tutorial, ubuntujupyter

Source: Internet
Author: User
Tags locale setting jupyter jupyter notebook install matplotlib

Ubuntu installation of Jupyter Notebook tutorial, ubuntujupyter

1. Introduction to Jupyter

Jupyter Notebook is an interactive Notebook that supports running more than 40 programming languages. Jupyter Notebook is essentially a Web application that facilitates the creation and sharing of Literary Program documents and supports real-time code, mathematical equations, visualization, and markdown. These functions include data cleaning and conversion, numerical simulation, statistical modeling, and machine learning.

Ii. Installation Steps

Environment: Docker (172.164.0-ce), image Ubuntu (162.164.3)

1. Update the Software List

 root@787c084a44e4:~# apt-get update

2. Install pip

 root@787c084a44e4:~# apt-get install -y python3-pip

3. Update pip (the-m parameter runs the pip module in the library as a script, -- upgrade updates the pip module)

 root@787c084a44e4:~# python3 -m pip install --upgrade pip

4. Use pip to install Jupyter

 root@787c084a44e4:~# python3 -m pip install jupyter

5. Use pip to install the python Drawing Library (for example, use it)

 root@787c084a44e4:~# python3 -m pip install matplotlib

6. Create the Jupyter Default Configuration File

 root@787c084a44e4:~# jupyter notebook --generate-config 

7. Generate a SHA1-Encrypted Key and save it, for example, 'sha1: xxxxxx'

root@787c084a44e4:~# ipython 

Input

 from notebook.auth import passwd  passwd()

8. Set the key and modify the configuration file.

 root@787c084a44e4:~# vim .jupyter/jupyter_notebook_config.py 

Add at the end of the file

 c.NotebookApp.password = u'sha1:XXXXXX'

9. Run Jupyter (-- ip Specifies ip, -- no-browser does not open the browser, -- allow-root allows root to run)

 root@787c084a44e4:~# jupyter notebook --ip=0.0.0.0 --no-browser --allow-root

10. Open your browser and enter http: // 172.17.0.2: 8888/


Iii. Jupyter example

Create python3 notes

%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(9)
y = np.sin(x)
plt.plot(x, y)
plt.show()

Running result


Iv. Exceptions

1. locale. Error: unsupported locale setting exception


Set locale and use default localization settings
Root @ 787c084a44e4 :~ # Export LC_ALL = C

2. OSError: [Errno 99] Cannot assign requested address exception


Add the -- ip = 0.0.0.0 parameter when running Jupyter.
Root @ 787c084a44e4 :~ # Jupyter notebook -- ip = 0.0.0.0 -- no-browser -- allow-root

3. ImportError: No module named 'matplotlib' exception


Install the matplotlib Library

root@787c084a44e4:~# python3 -m pip install matplotlib

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.


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.