在 Linux 上安装并运行 Jupyter

在 Linux 上安装并运行 Jupyter

根据官方文档安装Jupyter

在 Linux 上安装并运行 Jupyter_第1张图片

检查本机Python版本

输入

python -V

TensorFlow官网告知我们
在 Linux 上安装并运行 Jupyter_第2张图片
需要Python 2.7、3.4、3.5或3.6。
若版本不符合要求,则在安装库时会报错:

Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

Python的安装(新手向,老司机请跳过)

以Python3.6.8为例

通过以下链接下载并安装相应版本的Python
Python Source Releases
点击Gzipped source tarball下载到Python-3.6.8.tgz安装包
打开终端,并进入文件所在目录

#解压缩安装包
tar -zvxf  Python-3.6.8.tgz
#进入目录
cd Python-3.6.8
#为安装做好准备
./configure
#编译
make
#安装
make install
#清除临时文件
make clean

如果想了解更多以上命令,这里有一篇详解

安装完成后,还需要做一个软链接

cd /usr/bin
#删除原来的软链接
rm python
#新建软链接
sudo ln -s /usr/local/bin/python3.6 /usr/bin/python

现在尝试键入:

python

若显示以下文本,则说明成功

Python 3.6.8 (default, Feb 11 2019, 11:39:24) 
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
按照图一的官方文档继续操作就可以正确安装Jupyter

你可能感兴趣的:(机器学习)