zoukankan      html  css  js  c++  java
  • 安装ipython和jupyter

    本节内容;

    • 安装ipython
    • 安装jupyter
    • Pycharm介绍
    • Python软件包管理

    一、安装ipython

    1. python的交互式环境

     

    2. 安装ipython

    可以使用pip命令安装。如果你是用pyenv安装的python的话,pip命令已经有了。

    当需要安装包的时候,最好进入虚拟环境,为了保持基础版本的干净。

    1
    2
    [root@db test]# pyenv local cmdb
    (cmdb) [root@db test]# pip install ipython

    但是这样下载速度很慢,而且容易连接不上,ctrl+c终止。

    1
    2
    3
    4
    5
    6
    7
    # mkdir ~/.pip
    # vim ~/.pip/pip.conf
    [global]
    timeout = 6000
    index-url = http://mirrors.aliyun.com/pypi/simple/
    trusted-host = mirrors.aliyun.com
    # pip install ipython

    二、安装jupyter

    jupyter是一个可以让我们在浏览器上使用python环境。
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    # pip install jupyter
    # jupyter -h | less
    usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
                   [--paths] [--json]
                   [subcommand]
     
    Jupyter: Interactive Computing
     
    positional arguments:
      subcommand     the subcommand to launch
     
    optional arguments:
      -h, --help     show this help message and exit
      --version      show the jupyter command's version and exit
      --config-dir   show Jupyter config dir
      --data-dir     show Jupyter data dir
      --runtime-dir  show Jupyter runtime dir
      --paths        show all Jupyter paths. Add --json for machine-readable
                     format.
      --json         output paths as machine-readable json
     
    Available subcommands: bundlerextension console kernel kernelspec migrate
    nbconvert nbextension notebook qtconsole run serverextension troubleshoot
    trust
    (END)

      

    子命令notebook会启动一个浏览器。

    第一次访问时浏览器输入http://ip:8888/?token=b201c673885018b5a0b8e438139f978427bda8d190a4f4c5,我是在我自己笔记本上打开一个浏览器访问的。

    点击右边“New”,选择“Python3”。这样会在浏览器打开一个新选项卡,如下。

    补充说明:

    参数 --no-browser 就不会在当前Linux主机上启动浏览器。

    三、Python的IDE开发工具简介

    Python对开发工具的要求不是很高的。PyCharm是基于IDEA开发的。IDEA可以以插件的形式安装python插件。

    四、Python软件包管理

    easy_insall的作用和perl中的cpan, ruby中的gem类似,都提供了在线一键安装模块的傻瓜方便方式,

    而pip是easy_install的改进版, 提供更好的提示信息,删除package等功能。老版本的python中只有easy_install, 没有pip。

     
    或者在Pycharm中安装包,

  • 相关阅读:
    第三十八条:检查参数的有效性
    第二十九条:优先考虑类型安全的异构容器
    第二十八条:利用有限制通配符来提升API的灵活性
    C# 利用第三方SharpZipLib进行ZIP压缩
    无法解决 equal to 操作中 "Chinese_PRC_CI_AS_WS" 和 "Chinese_PRC_CI_AS" 之间的排序规则冲突
    使用EasyUI的treegrid犯的个低级错误
    Js千位分隔符
    Google Chrom浏览器默认只能显示字体大小大于等于12px
    Asp.Net2.0开发小问题汇总
    Oracle dbms_output.put_line长度限制问题
  • 原文地址:https://www.cnblogs.com/uestc2007/p/11019282.html
Copyright © 2011-2022 走看看