jupyter运行环境安装与使用

所有文章不设限,我们相遇偶然,相散坦然,互不打扰,各自安好,向阳而生

一.利用python环境,使用pip命令安装

1. 安装jupyter的方式

此处省去对于python环境的相关配置,直接介绍如何安装 jupyter 环境

打开cmd,输入如下命令

pip install jupyter

等待运行成功,jupyter环境即为安装完毕

然后cmd命令窗口直接输入如下命令,启动jupyter

Jupyter notebook

将会启动jupyter环境

jutpyter中python的程序无法运行 jupyter 运行python_环境变量

2. jupyter的中文配置

打开环境变量,在环境变量中添加如下

jutpyter中python的程序无法运行 jupyter 运行python_python_02

然后打开jupyter显示即为中文

3.配置jupyter的自动提示

安装nbextensions

在cmd终端环境中输入下列代码(就是打开命令符窗口)

pip install jupyter_contrib_nbextensions

上面安装完成后执行下列代码

jupyter contrib nbextension install --user --skip-running-check

安装完成后,勾选 “Table of Contents” 以及 “Hinterland”。

jutpyter中python的程序无法运行 jupyter 运行python_环境变量_03

4. 配置jupyter的主题

在cmd中输入以下命令:

pip install jupyterthemes

在cmd中执行命令如下,列出所有主题

jt -l

列出的即为主题目录,选定一个主题执行如下命令 jt -t 【主题名】-T -N

jt -t monokai -T -N

主题将会设置完成,此处给出优秀博客链接

5. 配置pip的国内源

国内源地址

清华大学:https://pypi.tuna.tsinghua.edu.cn/simple 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 阿里云:http://mirrors.aliyun.com/pypi/simple/ 腾讯云:https://mirrors.cloud.tencent.com/pypi/simple 华为云:https://repo.huaweicloud.com/repository/pypi/simple 豆瓣:http://pypi.douban.com/simple/ 网易:http://mirrors.163.com

使用cmd可以执行如下命令,完成pip国内源配置,加速模块安装 pip config set global.index-url 【国内源地址】

pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
6. 配置项目启动目录

第一种:在指定目录下打开cmd,启动jupyter

第二种:打开jupyter的安装配置,一般在pythongen目录的Scripts中,找到jupyter-notebook.exe可执行文件,然后创建快捷方式到桌面,参考下图设置"目标"框,把引号里的内容,替换为要是使用的工作目录。

jutpyter中python的程序无法运行 jupyter 运行python_jupyter_04

二.利用anconda的集成环境

此处不多赘述,相关设置参考如上即可,不过不是在cmd中执行,将会报错找不到命令

jutpyter中python的程序无法运行 jupyter 运行python_linux_05