【星海随笔】Centos8试用jupyter问题合集

CentOS 8 如何切换源?

本人使用的是阿里云的微服务

rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo
wget http://mirrors.cloud.aliyuncs.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget http://mirrors.cloud.aliyuncs.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g'  /etc/yum.repos.d/Centos-vault-8.5.2111.repo &&  sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo
yum clean all && yum makecache

安装python也需要安装很多配件
安装jupter遇到的问题

yum -y install python3-pip
pip3 install pylint
python -m pip install --upgrade --force pip 
pip install jupyter

查看jupyter的配置文件路径

jupyter-notebook --generate-config --allow-root

终端启动

jupyter-notebook --allow-root

后台启动

nohup jupyter notebook --allow-root > /jupyter/jupyter.log 2>&1 &

nginx配置一下jupter

server {
   server_name __;
   listen 8000;

    location / {
        proxy_pass http://127.0.0.1:8888;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_redirect off;
    }
}

以上的listen和proxy有冲突会导致,访问web IP 出现400 bad

设置jupter的这个参数为True

 c.NotebookApp.allow_remote_access = True

否则报 403 : Forbidden

忘记登录密码
重置密码

jupyter notebook --generate -config

无法打开代码框

#打开jupyter_notebook_config.py文件
#找到
c.NotebookApp.allow_origin = ' '
#' '改为‘*’

安装一些pip包,需要再虚拟环境中安装使用

root@DevelopmentNode ~ $ python3 -m venv tutorial-env
root@DevelopmentNode ~ $ source tutorial-env/bin/activate

安装request 失败
ERROR: Could not find a version that satisfies the requirement request (from versions: none)
ERROR: No matching distribution found for request

 pip install request -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

遇到有一个奇怪的问题 pandas不是panda

import pandas as pd 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值