Centos 7 linux系统搭建jupyter notebook服务

本文详细指导如何在Centos 7 Linux系统中下载并安装Anaconda,解决安装过程中的问题,配置环境变量,创建和管理conda环境,配置Jupyter Notebook,设置安全选项,最终启动服务并通过浏览器验证。
部署运行你感兴趣的模型镜像

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/为地址

6.将地址输入浏览器进行验证

在这里插入图片描述

您可能感兴趣的与本文相关的镜像

Python3.8

Python3.8

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值