搭建在线python运行环境

常遇到需要一个小工具,比如生成作息时间表,今天就搭建一个可在线使用的python运行环境
在这里插入图片描述
当然也可以交给ChatGPT完成
在这里插入图片描述

1、安装canda

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2019.03-Linux-x86_64.sh

yum install -y bzip2

bash Anaconda3-2019.03-Linux-x86_64.sh
Do you accept the license terms? [yes|no]
[no] >>> 
Please answer 'yes' or 'no':
>>> yes

Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> no

配置canda
vi /etc/profile

PATH=$PATH:/root/anaconda3/bin
export PATH

激活变量

source /etc/profile

2、配置notebook

# 生成配置
jupyter notebook --generate-config --allow-root
jupyter notebook password

#配置 jupyter_notebook_config.py
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha:ce...刚才复制的那个密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =9998 #可自行指定一个端口, 访问时使用该端口
c.ContentsManager.root_dir = '/root/notebook' 

3、启动notebook

jupyter notebook --ip=127.0.0.1 --port=28888 --allow-root
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值