当前位置:网站首页>Set up a remote Jupiter notebook
Set up a remote Jupiter notebook
2022-06-12 07:12:00 【Snow falls on the devil's land】
Catalog
download Anaconda
install
Use Anaconda
To configure jupyter Support remote access
To configure jupyter Use password access
Background operation jupyter
Preface
More than three people like me have responded to using online tutorials Anaconda There is a problem , Some can't , Some pretend to straighten themselves directly yum Orders don't work ,linux The servers are charged a full fee . To this end, I write you a simple installation tutorial , Avoid the pit that people may step on .
1. download Anaconda
Tsinghua source :
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive
Official website :
https://repo.anaconda.com/archive/
After countless times of practice, it has been proved that ,python3.6 The version is the most stable , Besides my linux Server is 64 position , For faster performance , So I choose to download 64 position , So finally I passed the following command , Directly in linux Download... On the server :
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.sh
2. install
perform :
sh Anaconda3-5.2.0-Linux-x86_64.sh
Please, press ENTER to continue
[[email protected]_0_9_centos ~]# sh Anaconda3-5.2.0-Linux-x86_64.sh
Welcome to Anaconda3 5.2.0
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
===================================
Anaconda End User License Agreement
===================================
...
Enter directly first , Press again q.
Ask if you agree to the agreement , fill yes.
Do you accept the license terms? [yes|no]
[no] >>> yes
Select installation location , Direct enter is installed in the current path , I chose to install in /opt/anaconda3 Under the table of contents .
Anaconda3 will now be installed into this location: /root/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/root/anaconda3] >>> /opt/anaconda3 PREFIX=/opt/anaconda3 installing: python-3.6.5-hc3d631a_2 ... Python 3.6.5 :: Anaconda, Inc. installing: blas-1.0-mkl ... installing: ca-certificates-2018.03.07-0 ... installing: conda-env-2.6.0-h36134e3_1 ... installing: intel-openmp-2018.0.0-8 ... ... installing: seaborn-0.8.1-py36hfad7ec4_0 ... installing: anaconda-5.2.0-py36_3 ... installation finished.
After a few minutes of waiting , The main program installation is complete . Ask if you will Anaconda3 Add to environment variables , Directly enter means no, Don't add .
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /root/.bashrc ? [yes|no]
[no] >>>
You may wish to edit your .bashrc to prepend the Anaconda3 install location to PATH:
export PATH=/opt/anaconda3/bin:$PATH
Thank you for installing Anaconda3!
Then ask if you want to install VSCode, fill no And return , Means not to install .
Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> no
At this point, the installer has finished , Then we carry out :
echo ". /opt/anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc
sudo ln -s /opt/anaconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh
Be careful :/opt/anaconda3 Change to the location you installed .
3. Use Anaconda
sign out shell after , Log in again , And then you can use it anaconda 了 .
Enter the environment :conda activate
Out of the environment :conda deactivate
[[email protected]_0_9_centos ~]# conda activate
(base) [[email protected]_0_9_centos ~]# python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
(base) [[email protected]_0_9_centos ~]# conda deactivate
[[email protected]_0_9_centos ~]# python
Python 2.7.5 (default, Jun 20 2019, 20:27:34)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[[email protected]_0_9_centos ~]#
4. To configure jupyter Support remote access
Generate jupyter The default configuration :
jupyter notebook --generate-config
(base) [[email protected]_0_9_centos ipython]# jupyter notebook --generate-config
Writing default config to: /root/.jupyter/jupyter_notebook_config.py
Modify the configuration :
(base) [[email protected]_0_9_centos ipython]# vi ~/.jupyter/jupyter_notebook_config.py
Cancel c.NotebookApp.ip='localhost' Notes .
And change it to c.NotebookApp.ip='*' that will do .
function jupyter:
jupyter notebook --allow-root
The effect is as follows :

Then, you can successfully access the remote host locally jupyter:

jupyter The current target directory depends on the directory where the command is executed .
5. To configure jupyter Use password access
The password to be configured uses passwd Function processing .
(base) [[email protected]_0_9_centos bak]# python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from notebook.auth import passwd
>>> passwd()
Enter password:
Verify password:
'sha1:13c0e9e600be:b1caae19615389900ba30f072caf1c5f4dd388b1'
>>>
above Enter password and Verify password Your input will not recall , Enter the password you need to configure twice and press enter , You can get sha1 code .
For example, the password I configured is 123456, be sha1 Code is :
sha1:13c0e9e600be:b1caae19615389900ba30f072caf1c5f4dd388b1
Edit it again jupyter To configure :
vi ~/.jupyter/jupyter_notebook_config.py
Cancel c.NotebookApp.password = '' Notes . Change it to :
c.NotebookApp.password = 'sha1:13c0e9e600be:b1caae19615389900ba30f072caf1c5f4dd388b1'
Other configuration :
c.NotebookApp.allow_root = True : root The user does not need to add --allow-root Parameters
c.NotebookApp.open_browser = False : The browser is not opened by default when starting
Run again jupyter:

Visit again at this time jupyter, You need to enter a password :

6. Background operation jupyter
Give Way jupyter Even if it turns off shell Also run in the background .
nohup jupyter notebook > jupyter.log 2>&1 &
Turn off the background running jupyter.
(base) [[email protected]_0_9_centos bak]# ps -ef|grep jupyter
root 3646 28946 1 19:47 pts/1 00:00:00 /opt/anaconda3/bin/python /opt/anaconda3/bin/jupyter-notebook
root 3771 28946 0 19:48 pts/1 00:00:00 grep --color=auto jupyter
(base) [[email protected]_0_9_centos bak]# kill 3646
(base) [[email protected]_0_9_centos bak]# ps -ef|grep jupyter
root 3861 28946 0 19:48 pts/1 00:00:00 grep --color=auto jupyter
边栏推荐
- D cannot use a non CTFE pointer
- Understanding management - four dimensions of executive power
- Leetcode: Sword finger offer 66 Build product array [application of pre and post infix]
- The most understandable explanation of coordinate transformation (push to + diagram)
- New knowledge: monkey improved app crawler
- Some operations of MATLAB array
- 报表工具的二次革命
- 5、 El expression & JSTL tag library
- 8086/8088 instruction execution pipeline disconnection reason
- SQL Server 2019 installation error. How to solve it
猜你喜欢

Demonstrate "topic communication, action communication, service communication and parameter server" with a small turtle case

Embedded gd32 code read protection

New knowledge: monkey improved app crawler

Day 4 of pyhon

Jackson XML is directly converted to JSON without writing entity classes manually

Drawing grid navigation by opencv map reading

Keil installation of C language development tool for 51 single chip microcomputer
![[Li Kou] curriculum series](/img/eb/c46a6b080224a71367d61f512326fd.jpg)
[Li Kou] curriculum series

LVDS drive adapter
![Leetcode: offer 60 Points of N dice [math + level DP + cumulative contribution]](/img/2b/41bd6a213892062f4c12721b5d4e8d.png)
Leetcode: offer 60 Points of N dice [math + level DP + cumulative contribution]
随机推荐
公众号也能带货?
leetcode. 39 --- combined sum
[image detection] SAR image change detection based on depth difference and pcanet with matlab code
[image denoising] salt and pepper noise image denoising based on Gaussian filter, mean filter, median filter and bilateral filter with matlab code attached
Tradeoff and selection of SWC compatible Polyfill
5 ROS simulation modeling (4-navigation navigation simulation)
RT thread studio learning (VII) using multiple serial ports
9 Sequence container
Detailed explanation of 8086/8088 system bus (sequence analysis + bus related knowledge)
Leetcode: offer 60 Points of N dice [math + level DP + cumulative contribution]
descheduler 二次调度让 Kubernetes 负载更均衡
Interview intelligence questions
node:打不开/node:已拒绝访问
Detailed explanation of memory addressing in 8086 real address mode
i. Mx6ul porting openwrt
Recommend 17 "wheels" to improve development efficiency
Pyhon的第六天
Dynamic coordinate transformation in ROS (dynamic parameter adjustment + dynamic coordinate transformation)
12.13-12.19 summary
postman拼接替换参数循环调用接口