Anaconda you need to add ipykernel after creating a python (2.7/3.6) virtual environment

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:

create -n python2 python=2.7

Use this command to create a python2 virtual environment called.

Jupyter Notebook Add python kernel

Create a folder under/usr/local/anaconda3/share/jupyter/kernels/, preferably using the name of the virtual environment for easy identification.

Of course, you can also CP Python3-r Python2, and then modify the Python2 command path in the Kernel.json file.

Save, restart Jupyter notebook.

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

install -n python2 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:

create -n python2 python=2.7 ipykernel

Anaconda you need to add ipykernel after creating a python (2.7/3.6) virtual environment

Related Article

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.