Jupyter Notebook Mammuals

1 篇文章 0 订阅
1 篇文章 0 订阅

Coding Interface: Jupyter Notebook

​ Official website: http://jupyter.org/

​ Using Anaconda installing Jupyter Notebook on Windows computer:

Anaconda:

Installation:

  1. Download Anaconda, official website: https://www.continuum.io/downloads or mirror from Tsing Hua university open software station: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
  2. Anaconda3 contains python 3.6, while Anaconda2 contains python 2.7.
  3. Please don’t use the install path with ’ ‘, such as “D:\Program Files\Anaconda3”, it will cause some error in future!
  4. Please choose “Add Anaconda to my PATH environment variable”.

Changing package source:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

Environment Management:

conda create -n python27 python=2.7         # install a new environment
conda info -e                               # Checking current environments
conda remove -n python27 --all              # remove an environment
activate python27                           # activate an environment on Windows
source activate python27                    # activate an environment on Linux/Mac
deactivate python27                         # deactivate an environment on Windows
source deactivate python                    # deactivate an environment on Linux/Mac
conda install -n python27 lxml              # install a package for a paticulate environment
conda remove -n python27 lxml               # uninstall a package from a paticulate environment

Jupyter notebook

Installation:

  1. Anaconda3-4.4.0 has already install Jupyter Notebook for its default python environment python3.6

  2. If you want to install Jupyter Notebook for an already existed environment, there has two ways:

    • Install Anaconda scientific Computing packages for the environment, it will default install Jupyter Notebook
    conda install -n python27 anaconda
    • Install Jupyter Notebook noly:
    conda install -n python27 ipykernel
  3. If you want to create a new environment which has Jupyter Notebook:

    conda create -n python27 python=2.7 ipykernel

    In the same way, if you want the new created environment has more package, please add package names after python=x.x.

  4. Add python2.7 kernel into Jupyter Notebook

    activate python27
    python -m ipykernel install --name=Python2.7
    python -m ipykernel install --name=Python2.7 --user    # add kernel option only to current user
    jupyter kernelspec list                               # list current kernels added in notebook
    jupyter kernelspec remove name_of_a_specific_kernel

How to start Notebook?

  1. Start Notebook local server

    jupyter nootbook        # start with open a browser
    jupyter nootbook --no-browser       # start without open a browser
  2. Help Documents:

    jupyter nootbook --help
  3. Changing default local host port. The notebook server default starts on port 8888. If port 8888 is unavailable or in use, the notebook server searches the next available port.

    jupyter nootbook --port 9999     # you can change the port number as your 
  4. Changing Default Working Space:

    jupyter notebook --generate-config
    
    # create configure file, usually at C:/users/curent_user/.jupyter/jupyter_notebook_config.py
    

    If system show that you have already has a configure file, don’t overwrite it!

    Find this “jupyter_notebook_config.py” configure file, and changing the line:

    
    # The directory to use for notebooks and kernels.
    
    
    # c.NotebookApp.notebook_dir = u''
    

    As:

    
    # The directory to use for notebooks and kernels.
    
    c.NotebookApp.notebook_dir = u'D:\Your\Jupypter\Workspace\Directory'

    Similarly, you can also create ipython configure file:

    ipython notebook --generate-config

Notebook Extension

There are many notebook extension package, you may need it:

conda install -c conda-forge jupyter_contrib_nbextensions

After install “jupyter_contrib_nbextensions”, you will find a new Label “Nbextension” on Notebook Home page.

这里写图片描述

You can choose your prefer extensions under this label.

Conda Extension on Jupyter Notebook:

Introduction pages: https://docs.continuum.io/anaconda/user-guide/tasks/use-jupyter-notebook-extensions

conda install nb_conda

This package will add a new Label “Conda” on Jupyter Notebook Home page. You can manage your environment and packages under this Laber.

You can edit your environment, notebook kernels and packages in this interface.

这里写图片描述

If you add “nb_conda ” package, it will add kernel choses in “new notebook”, and you can change the default kernel in the “Conda” interface.

这里写图片描述

It will also add “presentation” and “cloud” on each notebook’s edition pages.

这里写图片描述

Notice that, nb_cloud & nb_presentation only support on Windows 10. At lest it doesn’t work on my computer!

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值