centos7 jupyter notebook安装与远程访问(jupyter command not found)、快速安装python3环境(No module named ssl)

参考:
https://www.jianshu.com/p/960f011f712e
https://blog.csdn.net/m0_37903789/article/details/84657482?

1、安装jupyter

pip3 isntall jupyter

2、生成配置文件
jupyter notebook --generate-config

3、生成密钥
进入python环境:

from notebook.auth import passwd 
passwd() 
此时会让你两次输入密码(该密码作为客户端登录jupyter用),然后就会生成秘钥 (秘钥作为配置文件用) 
************


4、编辑配置文件
vim ~/.jupyter/jupyter_notebook_config.py

c.NotebookApp.ip='*'                                   # 就是设置所有ip皆可访问  
c.NotebookApp.password ='sha:ce...'       # 刚才复制的那个密文'  
c.NotebookApp.open_browser = False       # 禁止自动打开浏览器  
c.NotebookApp.port =8888                         # 随便指定一个端口  
c.NotebookApp.notebook_dir = '/home/xxx'		# 配置默认目录


5、在服务器端启动 jupyter notebook

jupyter notebook --allow-root


5、然后远程地址栏输入服务器ip:8888 就可访问了,输入密码,就可以成功登录了



注:

nohup jupyter notebook --allow-root  &			# 后台启动jupyter命令,nohup防止ssh断开,而服务停止。& 后台运行

jupyter: command not found、No module named '_ssl

参考:http://www.cppcns.com/jiaoben/python/239819.html

1、安装1.0.2版本的openssl
wget http://www.openssl.org/source/openssl-1.1.1.tar.gz
tar -zxvf openssl-1.1.1.tar.gz
cd openssl-1.1.1
./config --prefix=$HOME/openssl shared zlib
make && make install

2、设置环境变量LD_LIBRARY_PATH
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/openssl/lib" >> $HOME/.bash_profile
source $HOME/.bash_profile

3、然后再重新去安装python3解压make,带上--with-openssl=$HOME/openssl
tar -zxvf Python-3.7.0.tgz
./configure --prefix=$HOME/Py37 --with-openssl=$HOME/openssl
make && make install
1、下载依赖

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make -y
yum install libffi-devel -y


2、下载python3
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

3、解压编译安装

解压缩
tar -zxvf Python-3.7.0.tgz

进入解压后的目录,依次执行下面命令进行手动编译
./configure prefix=/usr/local/python3

编译安装
make && make install


4、添加软连接(python2、python3共存)

ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
此时我们敲入python3就是python3环境,pip3就是为python3环境安装wheel。





你可能感兴趣的:(知识点)