Jupyter Notebook installation environment

Jupyter Notebook installation environment

First, what is jupyter Notebook

1 Introduction

Jupyter Notebook is web-based applications for interactive computer applications may be, will be described allows a user text, a mathematical equation, the code of all the visualized contents to a shared document composition. - Jupyter official presentation Notebook

Simple words, jupyter Noetbook web page is open, you can open the page directly write the code, the code will run direct result of the code block below shows, if you write need to write code in the process of documentation, you can write directly on the same page , description will facilitate the timely, record, he explained.

2.IPython

  • Jupyter Notebook default IPython so we used CPython and what difference does it.

    • CPython

      • When we from Python official website after download and install Python 3.x, we have direct access to an official version of the interpreter: CPython. The interpreter is written in C language development, so called CPython. At the command line to run pythonit is to start CPython interpreter. CPython is the most widely used Python interpreter. All the code tutorials are also executed in CPython.
    • IPython

      • IPython is based on an interactive CPython interpreter, that is to say, just IPython has been enhanced in the interactive mode, but the execution of the functions and CPython Python code is exactly the same. Like many domestic browser Although the appearance is different, but the core are actually called IE. CPython used >>>as a prompt, and use IPython In [序号]:as a prompt.

3. part

  • Web applications

    • Web application that is web-based form, combined with the preparation of documentation, mathematical formulas, interactive computing and other forms of rich media tools. In short, the web application can realize various functions of the tool.
  • File

    • That is all interactive computing, writing documentation, mathematical formulas, images and other rich media in the form of input and output Jupyter Notebook in, are embodied in the form of a document

The main features of 4.Jupret Notebook

  • The default is Ipython

  • Among the preparation process has highlighted, tightening, tab completion function
  • Directly through the browser to run code to display the result in the next generation run
  • When code written documentation or statements that supports Markdown syntax

Second, the installation jupret Notebook

1. Install

  • installation tips

    • Premise installation Jupyter Notebook is the need to install Python (3.3 version and above, or version 2.7).
  • Installation using Anaconda

    • If you are white, then I suggest you install by Anaconda solve installation problems jupyter Noerbook because the jupyter Noetbook Anaconda has been automatically installed for you and other tools, and python in more than 180 scientific treasure and its dependencies.

    • You can also enter the Anaconda's official download page if you're reading; choose to download their own English documents headache, or for installation steps ignorant, or even want a quick look at what Anaconda is another one, you can go to my article Anaconda introduction, installation and tutorial . You want, all inside!

    • Conventionally, when the Anaconda installation release has been automatically installed Jupyter Notebook for you, but if it does not install automatically, then the terminal (Linux or macOS "terminal", Windows's "Anaconda Prompt", the following are referred to as " terminal "enter the following command) installation:

      • conda install jupyter notebook
  • Command to install using pip

    • If you are an experienced Python player, you want to try pip command to install Jupyter Notebook, then consider the following steps now! Enter the following commands in a terminal among the Oh!

      • Pip upgrade to the latest version

        • python3.x

        • ip3 install --upgrade pip
        • Python2.x

          pip install --upgrade pip
      • ⚠️ Note: Old versions of pip Jupyter Notebook installation process or face the problem of dependency can not be synchronized installed. Therefore strongly recommended to first pip upgrade to the latest version.

    • Installation Jupyter Notebook

      • Python3.x

        pip install jupyter
      • Python2.x

        pip install jupyter

Third, run Jupyter Noetbook

  • help

    • If you have any questions jupyter notebook command may consider reviewing official help documentation, the command is as follows:

      • jupyter notebook --help
      • jupyter notebook -h
  • start up

    • The default port start

      • An input terminal

        jupyter notebook
      • After executing the command, the terminal server information will be displayed in a series of notebook, while the browser will automatically start Jupyter Notebook.

        $ jupyter notebook
        [I 08:58:24.417 NotebookApp] Serving notebooks from local directory: /Users/catherine
        [I 08:58:24.417 NotebookApp] 0 active kernels
        [I 08:58:24.417 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
        [I 08:58:24.417 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
      • Note ⚠️: Note: After all the operations Jupyter Notebook, please keep the terminals are not closed , because once the terminal is closed, it will disconnect, you will not be able to operate it in the other Jupyter Notebook with links to the local server.

      • The browser address bar by default will be displayed: http://localhost:8888. Wherein, "localhost" refers to a native, "8888" is the port number.

      • If you simultaneously start multiple Jupyter Notebook, because the default port "8888" is occupied, so the number in the address bar from "8888" from each of more than a Jupyter Notebook starts number is incremented 1, such as "8889", "8890 "......
  • Start the specified port

    • If you want to customize the port to start Jupyter Noetbook can be entered in command in the terminal:

      jupyter notebook --port <port_number>

      among them," "Custom port number is written directly in digital form in order among the numbers on both sides without angle brackets" <> ", such as: jupyter notebook --port 9999 that the port number is" server 9999 to start Jupyter Notebook "in.

  • Start the service but does not open the browser

    • 如果你只是想启动Jupyter Notebook的服务器但不打算立刻进入到主页面,那么就无需立刻启动浏览器。在终端中输入:

      jupyter notebook --no-browser
    • 此时,将会在终端显示启动的服务器信息,并在服务器启动之后,显示出打开浏览器页面的链接。当你需要启动浏览器页面时,只需要复制链接,并粘贴在浏览器的地址栏中,轻按回车变转到了你的Jupyter Notebook页面。

  • 快捷键
    1. 向上插入一个cell:a
    2. 向下插入一个cell:b
    3. 删除cell:x
    4. 将code切换成markdown:m
    5. 将markdown切换成code:y
    6. 运行cell:shift+enter
    7. 查看帮助文档:shift+tab
    8. 自动提示:tab

Guess you like

Origin www.cnblogs.com/jiangchunsheng/p/11950515.html