Centos 7 linux系统搭建jupyter notebook服务
文章目录
1.下载安装Anaconda
1.1下载Anaconda
Wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
1.2安装Anaconda
bash Anaconda3-5.2.0-Linux-x86_64.sh
1.2.1问题解决
(1)若运行出现
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
使用yum命令安装bzip2
yum –y install bzip2
(2)使用yum命令时出现镜像不存在问题
使用命令
yum clean all
yum repolist all
运行后再进行yum –y install bzip2命令
若出现错误提示
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable <repoid>
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
进行资料查找有多种解决方式要有耐心一个个试
2.配置环境变量
2.1进行Anconda安装地址查看
地址为:/root/anaconda3/bin
2.2进行配置
export PATH="/root/anaconda3/bin:$PATH
2.3验证结果
conda –version
3.conda环境管理
3.1创建虚拟环境
conda create –n python3.6.5 python=3.6.5
3.2激活环境
source activate python3.6.5
3.3查看环境
conda env list
4.Jupyter配置
4.1生成配置文件
jupyter notebook --generate-config --allow-root
4.2生成登录密码
输入两次密码得到密文
4.1.2进行配置文件更改
输入命令vim ~/.jupyter/jupyter_notebook_config.py
进入相应界面更改如下
c.NotebookApp.ip=’自己的ip地址’
c.NotebookApp.allow_root=True
c.NotebookApp.open_brower=False
c.NotebookApp.port=8888(自己的端口号)
c.NotebookApp.password=’sha1: ’#输入配置密码得到的密文
c.ContentsManager.root_dir=’自己的文件地址’
5.启动Jupyter
5.1启动服务
jupyter notebook --allow-root
http://192.168.43.131:8888/
为地址