Jupyter Notebook adding Python kernel for anaconda virtual environments

Source: Internet
Author: User
Tags virtual environment jupyter jupyter notebook

In the process of working today, you encounter the problem of installing Anaconda using Conda to create a virtual environment, but after starting Jupyter notebook, you cannot find Python kernel in the virtual environment. Later on the internet found a solution, as follows:

Create a virtual environment

First look at the commands that created the virtual environment at that time:

conda create -n rqalpha python=3.5

Use this command to create a rqalpha virtual environment called.

Jupyter Notebook Add python kernel

C:\Users\yinzm\AppData\Roaming\jupyter\kernels\Create a folder below, it is best to use the name of the virtual environment, easy to identify. Then create a Kernel.json file under the folder with the following file contents:

{ "language": "python", "display_name": "rqalpha", "argv": [  "D:\\Anaconda3\\envs\\rqalpha\\python.exe",  "-m",  "ipykernel_launcher",  "-f",  "{connection_file}" ]}

Save, restart Jupyter notebook.

After restarting, it was found that there was a rqalpha kernel, but the kernel was never started. Later found to be a lack of ipykernel. Then use the following command to install:

conda install -n rqalpha ipykernel

So far, the problem has been solved.

If you often need to use jupyter notebook, it is best to install the Ipykernel when creating the virtual environment, the command is as follows:

conda create -n rqalpha python=3.5 ipykernel
Reference
    • Http://www.jianshu.com/p/f70ea020e6f9

Jupyter Notebook adding Python kernel for anaconda virtual environments

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.