最新消息:

Python课程系列:Mac OS / Windows 安装 Jupyter

Python 少儿编程 1949浏览 0评论

sublime IDEPython 程序编程,每次写完程序还是需要去下 python xx.py 指令,比较麻烦一点。网络上有 Jupyter 这个 Web IDE,很方便直接写完Python 程序就可以执行、看结果。本文就把安装的方式分享给大家,安装版本分为 OSX Windows,大家可以依自己的计算机环境去安装。

 

Python课程系列:Mac OS / Windows 安装 Jupyter

 

Jupyter 介绍

Jupyter 主要提供一个网页接口,让用户可以透过浏览器撰写程序,可以在上面进行 Python R Scala 程序的开发!功能相当强大。

安装步骤 (OS X 版本)

Step 1. OS X 安装 Homebrew 套件管理程序

Homebrew 使用 Ruby 语言开发,是一套简单并且具有弹性的套件管理工具,可以帮助用户在 OS X 系统上安装 Unix 程序,安装方法很简单,打开 Mac 终端机,输入下方指令即可

ruby -e “$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)” 

Step 2. 透过 Homebrew 套件管理安装 Python

接下来就可以简单透过 Homebrew 开始安装 Python,至于 Python 版本看个人需求,由于 Python 2 目前支持的套件还是比较多,我是选择 2

python2 安装

brew install python 

python3 安装

brew install python3 

最后可以透过指令确认 Python 目前版本

python –version 

Step 3:安装 Jupyter

此步骤需要使用 Python 程序语言的套件管理程序 pip来做安装,在安装完 Python 之后,就可以使用 pip 这指令来安装 Python 所需要的 Lib 或是套件,指令如下:

python2 安装

pip install jupyter 

python3 安装

pip3 install jupyter 

安装完成后输入下列指令启动 Jupyter 网页服务

jupyter notebook 

 

Python课程系列:Mac OS / Windows 安装 Jupyter

 

Step 4:开启新页面撰写 Python 程序

接下来可以新增一个新的 Notebook,开始撰写你要的程序

 

Python课程系列:Mac OS / Windows 安装 Jupyter

Python课程系列:Mac OS / Windows 安装 Jupyter

 

安装步骤 (Windows 版本)

Step 1. Windows 上安装 Python

首先到https://www.python.org/downloads/下载 Python 安装档,下载后就直接下一步到最后,即可安装完成。至于 Python 版本看个人需求,跟OS X版本一样我

Python课程系列:Mac OS / Windows 安装 Jupyter

 

Step 2. 设定 Windows 环境变量

1.在我的计算机点选右键选择内容

 

Python课程系列:Mac OS / Windows 安装 Jupyter

 

2. 点选进阶设定

 

Python课程系列:Mac OS / Windows 安装 Jupyter

 

3. 进入进阶页签,点选环境变量

 

Python课程系列:Mac OS / Windows 安装 Jupyter

 

4. 于下方path变量点选编辑,并在最后面输入;C:Python27;C:Python27Scripts

 

Python课程系列:Mac OS / Windows 安装 Jupyter

Python课程系列:Mac OS / Windows 安装 Jupyter

 

Step 3. 安装 Jupyter

此步骤需要使用 Python 程序语言的套件管理程序 pip来做安装,在安装完 Python 之后,就可以使用 pip 这指令来安装 Python 所需要的 Lib 或是套件,指令如下:(需要开启 Windows 命令提示字符窗口来输入指令)

python2 安装

pip install jupyter 

python3 安装

pip3 install jupyter 

 

Python课程系列:Mac OS / Windows 安装 Jupyter

Python课程系列:Mac OS / Windows 安装 Jupyter

 

安装完成后输入下列指令启动 Jupyter 网页服务

jupyter notebook 

 

Python课程系列:Mac OS / Windows 安装 Jupyter

 

输入完指令后,浏览器即会开起 Jupyter 网页服务

 

Python课程系列:Mac OS / Windows 安装 Jupyter

 

Step 4:开启新页面撰写 Python 程序

接下来可以新增一个新的 Notebook,开始撰写你要的程序

 

Python课程系列:Mac OS / Windows 安装 Jupyter

Python课程系列:Mac OS / Windows 安装 Jupyter

您必须 登录 才能发表评论!