How to use both Python2 and 3 in Jupyter

Source: Internet
Author: User
Tags jupyter jupyter notebook

How to use both Python2 and 3 in Jupyter.


Since I am installing Jupyter notebook through anaconda, the coexistence of Anaconda2 (Python2) and Anaconda3 (Python3) needs to be addressed first.


You only need to select the Anaconda3 installation directory in the D:\Anaconda2\envs subdirectory. Detailed installation tutorials See this blog post: http://blog.csdn.net/infin1te/article/details/50445217


After the installation is complete, the direct input python inside cmd will start Python2, and then use python to switch to Python3 after using activate Py3 (Py3 the name of the directory folder before Python3 install).


The Python2 and Python3 two cores already exist in the Jupyter notebook, but are not tested.


There are tutorials on the web that have to activate the Jupyter notebook kernel (ipykernel), which can only be used in 2 versions, and use the official documentation (

Http://ipython.readthedocs.io/en/stable/install/kernel_install.html

Tutorial installs the kernel:


python3-m pip Install Ipykernel

Python3-m Ipykernel Install--user


Currently 2 versions are available.


Reference:

1, http://blog.csdn.net/infin1te/article/details/50445217

2, Https://stackoverflow.com/questions/30492623/using-both-python-2-x-and-python-3-x-in-ipython-notebook

3, http://ipython.readthedocs.io/en/stable/install/kernel_install.html


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.