python3.12安装jupyter环境

一、编译安装python3.12
python3.12必须使用openssl1.1.1以上版本,否则pip安装组件的时候会报SSLErr错误
1.编译安装openssl1.1.1

wget -c https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz

tar -zxvf openssl-1.1.1w.tar.gz

./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib
make install -j 4

ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl

echo "/usr/local/openssl/lib" >> /etc/ld.so.conf.d/openssl.conf

ldconfig

2、编译安装python3.12

wget -c https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tar.xz
tar -xvf Python-3.12.4.tar.xz
./configure --enable-optimizations --with-openssl=/usr/local/openssl --prefix=/usr/local/python3

make install -j 4

ln -sf /usr/local/python3/bin/python3.12 /usr/local/bin/python
ln -sf /usr/local/python3/bin/python3.12 /usr/local/bin/python3
ln -sf /usr/local/python3/bin/pip3.12 /usr/local/bin/pip3
ln -sf /usr/local/python3/bin/pip3.12 /usr/local/bin/pip

vi /etc/profile
export PYTHON_HOME=/usr/local/python3
export PATH=$PATH:$PYTHON_HOME/bin:

3、使用pip安装jupyter服务

#安装组件
pip install jupyter notebook

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

#在生成的~/.jupyter/jupyter_notebook_config.py配置文件最后加入
c.NotebookApp.ip="*"
c.NotebookApp.allow_root=True
c.NotebookApp.open_browser=False
c.NotebookApp.port=4090
c.ContentsManager.root_dir='/opt/jupyter/root'

#生成密码
jupyter notebook password

#启动服务
nohup jupyter notebook > /opt/jupyter/jupyter.log 2>&1 &
 

附:vbox虚拟机分区调整(/home:150G /root:50G)

1、卸载/home目录  umount /home  如提示device is busy,可使用lsof /home命令取得pid后执行kill 直接到卸载成功

2、移除/home分区 lvremove /dev/mapper/centos-home

3、扩展/root所在的lv,增加100G lvextend -L +100G /dev/mapper/centos-root

4、扩展/root文件系统xfs_growfs /dev/mapper/centos-root

5、重新创建/home分区 lvcreate -L 40G -n home centos

6、挂载/home分区 ​mount /dev/centos/home /home

7、查看分区信息 df -hT

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值