Install Python2 and Python3 at the same time in Jupyter notebook (you can switch at random in Jupyter)

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

Since the Jupyter notebook I used earlier is based on the python2.7 version, just install the python3.6 based kernel on this basis.

My environment is as follows:

Windows 10, 64-bit systems

Installed based on python2.7 version of Anaconda

Installed the PY27 and PY36 virtual environment in Anaconda

The kernel of existing Jupyter notebook is based on python2.7 version py27 kernel based on py36

In Jupyter notebook, select a different Python version, called the Kernel (kernel). When installing, install Ipykernel.

In the previous article, I installed the Anaconda virtual environment py36 on the specified path (D:\ANACONDA2\ENVS\PY3), so when installing Ipykernel, you also need to specify the installation. The installation command is "Conda install--prefix=d:\anaconda2\envs\py3 Ipykernel", as follows:


Then activate the PY36 virtual environment and enter the command:

Avcivate D:\Anaconda2\envs\py3

Python-m Ipykernel Install--user


Start Jupyter notebook To see, then you can see that the Python3 kernel has been installed.



Similarly, the kernel method of Python2 on the base of the Python3 kernel is also applicable.

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.