当前位置: 代码网 > it编程>前端脚本>Python > python3.12安装jupyter环境的实现

python3.12安装jupyter环境的实现

2025年05月19日 Python 我要评论
一、编译安装python3.12python3.12必须使用openssl1.1.1以上版本,否则pip安装组件的时候会报sslerr错误1.编译安装openssl1.1.1wget -c https

一、编译安装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

到此这篇关于python3.12安装jupyter环境的实现的文章就介绍到这了,更多相关python3.12安装jupyter内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com