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.