我是靠谱客的博主 背后云朵,这篇文章主要介绍jupyter python_Jupyter Notebook支持多python版本,现在分享给大家,希望可以做个参考。

Jupyter notebook里的代码有py2.7也有py3.0的,本文讲解如何使Jupyter同时支持多个python版本(python2.7.5 + python3.6.2)。

#cenos7默认安装了python2.7.5

[work@mars ~]$ python -V

Python 2.7.5

#安装python3依赖

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make -y

#安装python3

wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz

tar -xvJf Python-3.6.2.tar.xz

cd Python-3.6.2

./configure prefix=/usr/local/python3 #指定安装位置

su root

make && make install

#添加软链

ln -s /usr/local/python3/bin/python3 /usr/bin/python3

ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

#检查版本

[root@mars ~]# python3 -V

Python 3.6.2

[root@mars ~]# pip3 install --upgrade pip

#安装常用python3 lib

[work@mars ~]# sudo pip3 install ipykernel numpy joblib keras tensorflow matplotlib pydot

#Jupyter注册python3内核

[work@mars jupyter]$ python3 -m ipykernel install --user

Installed kernelspec python3 in /home/work/.local/share/jupyter/kernels/python3

刷新jupyter,查看可选的kernel,会多出python3选项:

python3.png

最后

以上就是背后云朵最近收集整理的关于jupyter python_Jupyter Notebook支持多python版本的全部内容,更多相关jupyter内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(99)

评论列表共有 0 条评论

立即
投稿
返回
顶部