iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >pycharm中jupyter的使用图文教程
  • 1453
分享到

pycharm中jupyter的使用图文教程

2024-04-02 19:04:59 1453人浏览 安东尼

Python 官方文档:入门教程 => 点击学习

摘要

步骤 1、安装Jupyter pip install jupyter 2、 新建一个Ipython文件 3、在Terminal里启动Jupyter Notebook 4、

步骤

1、安装Jupyter


pip install jupyter

2、 新建一个Ipython文件

这里写图片描述

3、在Terminal里启动Jupyter Notebook

这里写图片描述

4、 编写程序

随便写点什么测试一下,应该得到的结果是这样的:


print(1) 

点击运行!

这里写图片描述

填入上面的地址即可

补充:Linux下安装Pycharm和jupyter

linuxPython

Centos7下默认

在这里插入图片描述

安装python3

默认情况下 CentOS7 系统中自带的 Python 版本是2.7版本。我们当前工作的Python版本几乎全为 Python3 版本,所以可以通过 yum 软件包管理工具安装python3版本, 不过由

于 CentOS7 的 Base 软件包仓库默认没有 Python3版本 ,因此查找失败,


[root@localhost ~]# yum list "*python3*"
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Error: No matching Packages to list

除了 Base 仓库,还可以使用 epel 仓库,要想使用 epel 仓库,需要先安装一下 epel 仓库,安装过程如下


[root@localhost ~]# yum install epel-release -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.njupt.edu.cn
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch             Version         Repository        Size
================================================================================
Installing:
 epel-release           noarch           7-11            extras            15 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:
warning: /var/cache/yum/x86_64/7/extras/packages/epel-release-7-11.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for epel-release-7-11.noarch.rpm is not installed
epel-release-7-11.noarch.rpm                               |  15 kB   00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53D7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-5.1804.el7.centos.x86_64 (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                     1/1 
  Verifying  : epel-release-7-11.noarch                                     1/1 

Installed:
  epel-release.noarch 0:7-11                                                    

Complete!

epel 仓库安装完毕后,使用 yum 命令再次查询 python3 ,发现有多个不同版本的 python3软件包。


root@localhost ~]# yum list "*python3*"
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                     | 7.1 kB     00:00     
 * base: centos.ustc.edu.cn
 * epel: mirrors.yun-idc.com
 * extras: mirrors.163.com
 * updates: centos.ustc.edu.cn
epel                                                     | 4.7 kB     00:00     
(1/3): epel/x86_64/group_gz                                |  88 kB   00:00     
(2/3): epel/x86_64/updateinfo                              | 1.0 MB   00:03     
(3/3): epel/x86_64/primary_db                              | 6.6 MB   00:05     
Available Packages
abrt-addon-python3.noarch                2.1.11-49.el7                      epel
boost-python34.x86_64                    1.53.0-28.el7                      epel
boost-python34-devel.x86_64              1.53.0-28.el7                      epel
python3-urjtag.x86_64                    2017.10-2.el7                      epel
python3-virtualenv-doc.noarch            15.1.0-2.el7                       epel
python34.x86_64                          3.4.9-2.el7                        epel
python34-Cython.x86_64                   0.23.5-1.el7                       epel
python34-PyMysql.noarch                  0.9.2-1.el7                        epel
python34-PyYAML.x86_64                   3.11-3.el7                         epel
·
·省略部分软件包信息.......
·
python34-aiOSmtpd.noarch                 1.0-2.el7                          epel
python34-zope-interface.x86_64           4.3.3-1.el7                        epel
python34-zope-schema.noarch              4.4.1-2.el7                        epel
python34-zope-testing.noarch             4.1.2-2.el7                        epel
python36.x86_64                          3.6.6-2.el7                        epel
python36-PyYAML.x86_64                   3.11-3.el7                         epel
python36-asn1crypto.noarch               0.24.0-6.el7                       epel
python36-blosc.x86_64                    1.2.8-4.el7                        epel
python36-bsddb3.x86_64                   6.2.6-3.el7                        epel
python36-chardet.noarch                  2.3.0-4.el7                        epel
uwsgi-plugin-python34-gevent.x86_64      2.0.17.1-1.el7                     epel
uwsgi-plugin-python34-tornado.x86_64     2.0.17.1-1.el7                     epel
uwsgi-plugin-python36.x86_64             2.0.17.1-1.el7                     epel
uwsgi-plugin-python36-gevent.x86_64      2.0.17.1-1.el7                     epel

[root@localhost ~]# yum install python36 -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.njupt.edu.cn
 * epel: mirrors.yun-idc.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package python36.x86_64 0:3.6.6-2.el7 will be installed
--> Processing Dependency: python36-libs(x86-64) = 3.6.6-2.el7 for package: python36-3.6.6-2.el7.x86_64
--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: python36-3.6.6-2.el7.x86_64
--> Running transaction check
---> Package python36-libs.x86_64 0:3.6.6-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package               Arch           Version                Repository    Size
================================================================================
Installing:
 python36              x86_64         3.6.6-2.el7            epel          66 k
Installing for dependencies:
 python36-libs         x86_64         3.6.6-2.el7            epel         8.6 M

Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 8.6 M
Installed size: 36 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/epel/packages/python36-3.6.6-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for python36-3.6.6-2.el7.x86_64.rpm is not installed
(1/2): python36-3.6.6-2.el7.x86_64.rpm                     |  66 kB   00:01     
(2/2): python36-libs-3.6.6-2.el7.x86_64.rpm                | 8.6 MB   00:29     
--------------------------------------------------------------------------------
Total                                              297 kB/s | 8.6 MB  00:29     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python36-libs-3.6.6-2.el7.x86_64                             1/2 
  Installing : python36-3.6.6-2.el7.x86_64                                  2/2 
  Verifying  : python36-3.6.6-2.el7.x86_64                                  1/2 
  Verifying  : python36-libs-3.6.6-2.el7.x86_64                             2/2 

Installed:
  python36.x86_64 0:3.6.6-2.el7                                                 

Dependency Installed:
  python36-libs.x86_64 0:3.6.6-2.el7                                            

Complete!

python36 安装成功后,可以使用 rpm 命令查看一python36 具体包含哪些命令和文件


root@localhost ~]# rpm -ql python36
/usr/bin/pydoc3.6
/usr/bin/python3.6
/usr/bin/python3.6m
/usr/bin/python36
/usr/bin/pyvenv-3.6
/usr/share/doc/python36-3.6.6
/usr/share/doc/python36-3.6.6/README.rst
/usr/share/licenses/python36-3.6.6
/usr/share/licenses/python36-3.6.6/LICENSE
/usr/share/man/man1/python3.6.1.gz

CentOS7系统中PyCharm环境使用


[python@localhost ~]$ wget https://download.jetbrains.com/python/pycharm-commUnity-2018.3.5.tar.gz
--2019-03-25 17:27:00--  Https://download.jetbrains.com/python/pycharm-community-2018.3.5.tar.gz
Resolving download.jetbrains.com (download.jetbrains.com)... 54.72.98.183, 52.18.241.155, 2a05:d018:93b:d103:524e:e6ed:6592:1823, ...
Connecting to download.jetbrains.com (download.jetbrains.com)|54.72.98.183|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://download.jetbrains.8686c.com/python/pycharm-community-2018.3.5.tar.gz [following]
--2019-03-25 17:27:02--  https://download.jetbrains.8686c.com/python/pycharm-community-2018.3.5.tar.gz
Resolving download.jetbrains.8686c.com (download.jetbrains.8686c.com)... 60.221.21.254, 2408:876c:0:100::25
Connecting to download.jetbrains.8686c.com (download.jetbrains.8686c.com)|60.221.21.254|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 311914955 (297M) [application/octet-stream]
Saving to: ‘pycharm-community-2018.3.5.tar.gz'

100%[=================================================================================================>] 311,914,955 1.22MB/s   in 7m 53s 

2019-03-25 17:34:55 (644 KB/s) - ‘pycharm-community-2018.3.5.tar.gz' saved [311914955/311914955]

[python@localhost ~]$
[python@localhost ~]$ ll
total 304644
drwxr-xr-x. 2 python python      4096 Mar 25 17:02 Desktop
drwxr-xr-x. 2 python python      4096 Mar 25 17:02 Documents
drwxr-xr-x. 2 python python      4096 Mar 25 17:02 Downloads
drwxr-xr-x. 2 python python      4096 Mar 25 17:02 Music
drwxr-xr-x. 2 python python      4096 Mar 25 17:02 Pictures
drwxr-xr-x. 2 python python      4096 Mar 25 17:02 Public
-rw-rw-r--. 1 python python 311914955 Feb 27 19:15 pycharm-community-2018.3.5.tar.gz
drwxr-xr-x. 2 python python      4096 Mar 25 17:02 Templates
drwxr-xr-x. 2 python python      4096 Mar 25 17:02 Videos

上图中,下载软件包过程比较慢,建议提前下载好对应的软件包,方便后续安装操作。安装过程比较简单,直接解压开就可以使用


[python@localhost ~]$ mkdir software
[python@localhost ~]$ tar xf pycharm-community-2018.3.5.tar.gz -C software/
[python@localhost ~]$ cd software
[python@localhost software]$ mv pycharm-community-2018.3.5 pycharm180305
[python@localhost software]$ cd pycharm180305/
[python@localhost pycharm180305]$ cd bin
[python@localhost bin]$ ls
fORMat.sh     fsnotifier-arm   libdbm64.so  pycharm64.vmoptions  pycharm.svg
fsnotifier    idea.properties  log.xml      pycharm.png          pycharm.vmoptions
fsnotifier64  inspect.sh       printenv.py  pycharm.sh           restart.py
[python@localhost bin]$ ./pycharm.sh 
Mar 25, 2019 5:45:20 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Mar 25, 2019 5:45:20 PM java.util.prefs.FileSystemPreferences$6 run
WARNING: Prefs file removed in background /home/python/.java/.userPrefs/prefs.xml

这个属于版本问题

在这里插入图片描述 在这里插入图片描述

利用Pycharm安装Jupyter

通过 CentOS7 系统桌面中创建的 pycharm 快捷方程式打开 pycharm ,然后点击 pycharm中的控制台,进行 pip 的跟新 和 jupyter 的安装

在这里插入图片描述


(venv) [python@localhost test]$ pip install --upgrade pip
(venv) [python@localhost test]$ pip install jupyter
(venv) [python@localhost test]$ jupyter notebook --ip=0.0.0.0 --port=8000
[I 18:25:00.814 NotebookApp] Serving notebooks from local directory: /home/python/PycharmProjects/test
[I 18:25:00.815 NotebookApp] The Jupyter Notebook is running at:
[I 18:25:00.815 NotebookApp] http://(localhost.localdomain or 127.0.0.1):8000/?token=f7d20e19f9abf2cd8323034c6a60e6bf0a3c30a98f866fbc
[I 18:25:00.815 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:25:00.833 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///run/user/1001/jupyter/nbserver-8326-open.html
    Or copy and paste one of these URLs:
        http://(localhost.localdomain or 127.0.0.1):8000/?token=f7d20e19f9abf2cd8323034c6a60e6bf0a3c30a98f866fbc
^C[I 18:25:14.249 NotebookApp] interrupted
Serving notebooks from local directory: /home/python/PycharmProjects/test
0 active kernels
The Jupyter Notebook is running at:
http://(localhost.localdomain or 127.0.0.1):8000/?token=f7d20e19f9abf2cd8323034c6a60e6bf0a3c30a98f866fbc
Shutdown this notebook server (y/[n])? y
[C 18:25:16.200 NotebookApp] Shutdown confirmed
[I 18:25:16.210 NotebookApp] Shutting down 0 kernels
(venv) [python@localhost test]$

以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程网。

--结束END--

本文标题: pycharm中jupyter的使用图文教程

本文链接: https://www.lsjlt.com/news/126798.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • pycharm中jupyter的使用图文教程
    步骤 1、安装Jupyter pip install jupyter 2、 新建一个IPython文件 3、在Terminal里启动Jupyter Notebook 4、 ...
    99+
    2024-04-02
  • 教你使用Pycharm配置远程Jupyter
    前段时间,在pycharm里配置了远程的Python解释器,然后在使用过程中,发现pycharm原来是可以使用Jupyter的文件,而且还可以配置远程的Jupyter环境,今天试了一...
    99+
    2024-04-02
  • jupyter notebook内核配置的图文教程
    目录添加内核查看已有内核列表重命名内核删除内核总结我的 jupyter-bootbook 是在 ubuntu 下安装 anaconda 获得的,下面的命令在 Windows 下大部分...
    99+
    2024-04-02
  • PyCharm使用教程(详细版 - 图文结合)
    目录 一、创建项目 二、运行 三、错误提示 四、安装三方包 PyCharm的使用贯穿整个Python的学习,所以单独拿出来出教程不合适,说多了对于新手来说也还是不明白,这里我们先从学习开始前大家需要用到PyCharm的一些功能讲起,后面的...
    99+
    2023-09-11
    python 运维开发 爬虫 后端 pycharm
  • 如何在pycharm中使用jupyter
    本篇文章给大家分享的是有关如何在pycharm中使用jupyter,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。步骤1、安装Jupyterpip install&nb...
    99+
    2023-06-15
  • Jupyter Notebook使用教程
    Jupyter Notebook使用教程 一、什么是Jupyter Notebook二、jupyter notebook的简单使用三、jupyter运行环境的配置——一python运行环境为例...
    99+
    2023-09-10
    jupyter python ide
  • Python及PyCharm安装教程【图文教程】
    目录 一、前言 二、Python安装 1.Python官网下载 2.运行Python 三、开发工具PyCharm安装 1.PyCharm官网下载 2.激活码分享 一、前言 目前,Python有两个版本,一个是2.x版,一个是3...
    99+
    2023-09-24
    pycharm ide python
  • Jupyter的安装和使用教程
    这篇文章主要介绍“Jupyter的安装和使用教程”,在日常操作中,相信很多人在Jupyter的安装和使用教程问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Jupyter的安装和使用教程”的疑惑有所帮助!接下来...
    99+
    2023-06-04
  • PyCharm安装教程,图文教程(超详细)
    「作者简介」:CSDN top100、阿里云博客专家、华为云享专家、网络安全领域优质创作者 「推荐专栏」:对网络安全感兴趣的小伙伴可以关注专栏《网络安全入门到精通》 PyCharm 一、...
    99+
    2023-09-02
    python 人工智能 ai
  • VS2022中使用Copilot的图文教程
    Copilot可以自动帮你写代码。 1.打开vs2022,点击扩展,在里面搜索copilot安装 2.安装完成后,左下角有个小图标就是copilot 3.点击登录 会弹框 点...
    99+
    2024-04-02
  • pycharm使用教程
    使用教程:1、创建项目:打开PyCharm,点击“Create New Project”,选择项目路径,点击“Create”开始创建;2、创建文件:在项目界面,点击“file”,再点“new”创建子目录或者文件,选择要创建的文件类型;3、运...
    99+
    2023-12-09
    pycharm
  • pycharm创建并使用虚拟环境的详细图文教程
    目录一、安装对应包二、创建虚拟环境三、激活进入虚拟环境①使用 pycharm 的 Terminal 切换虚拟环境②直接使用 pycharm 切换虚拟环境(推荐使用)总结 一...
    99+
    2024-04-02
  • Pycharm配置anaconda环境图文教程
    目录1.配置anaconda环境2.pycharm配置anaconda环境1.配置anaconda环境 以下内容在下载完anaconda后实现 快捷键win+r,打出命令行cmd,进...
    99+
    2022-11-13
    Pycharm配置anaconda anaconda配置环境 Pycharm anaconda环境
  • Jupyter Notebook 安装与使用教程
    一、什么是Jupyter Notebook? 1. 简介        Jupyter Notebook是基于网页的用于交互计算的应用程序。其可被应用于全过程计算:开发、文档编写、运行代码和展示结果。——Jupyter Notebook官方...
    99+
    2023-09-20
    jupyter python ide
  • 在 IDEA 中使用 Git 图文教程
    Git 专栏索引: Git 分布式版本控制系统使用教程 在 IDEA 中使用 Git 图文教程 在 IDEA 中使用 Git 图文教程 🚀1. 配置 GitὨ...
    99+
    2023-09-21
    IDEA Git Gitee
  • 使用Pycharm创建一个Django项目的超详细图文教程
    目录Django 简介创建Django的虚拟环境创建Django项目总结 Django 简介 Django是一个开放源代码的Web应用框架,由Python写成。采用了MTV...
    99+
    2024-04-02
  • 2021年pycharm的最新安装教程及基本使用图文详解
    设置pycharm的主题背景 选择python解释器的版本 pycharm设置字体 控制台设置 Pycharm的基本使用 1.在Pycharm下为你的Python项目配置Py...
    99+
    2024-04-02
  • pycharm配置python环境的详细图文教程
    目录安装pycharm安装pythonpycharm配置python,并激活pycharm界面运行一下取消更新总结 安装pycharm PyCharm 的下载地址:http...
    99+
    2023-01-07
    pycharm搭建python环境 pycharm配置python环境 pycharm如何配置环境变量
  • PyCharm安装配置Qt Designer+PyUIC图文教程
    PyCharm安装配置Qt Designer+PyUIC教程 1、安装依赖 命令形式 pip install PyQt5 pip install pyqt5-tools 界面...
    99+
    2024-04-02
  • jupyter notebook安装中文及使用
    jupyter notebook 一;下载 首先下载jupyter库(pip install jupyter),下载完后,在命令行直接输入jupyter notebook就能进入页面了。 …… 二;设置中文 jupyter notebook...
    99+
    2023-09-11
    python jupyter
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作