Install python2, python3, and jupyterpython2 simultaneously in jupyter notebook.

Source: Internet
Author: User
Tags jupyter jupyter notebook

Install python2, python3, and jupyterpython2 simultaneously in jupyter notebook.

I have discussed how to install multiple python versions in anaconda. In this article, I will discuss how to install python2.7 and python3.x simultaneously in jupyter notebook.

Since the jupyter notebook I used earlier is based on python3.5, you only need to install the kernel based on python2.7 on this basis.

My environment is as follows:

  • Windows 7, 64-bit

  • Anaconda Based on python3.5 has been installed

  • Python 27 and py36 virtual environments have been installed in anaconda

  • The kernel of the existing jupyter notebook is based on python3.5

Install the kernel of py27 on the basis of the kernel of py35

In jupyter notebook, select different python versions, called kernel (kernel ). Install ipykernel during installation.

In the previous article, I installed anaconda's virtual environment py27 in the specified path (D: \ pyenv \ py27). Therefore, you also need to specify the installation when installing ipykernel. The installation command is "conda install -- prefix = D: \ pyenv \ py27 ipykernel", as follows:

Activate the virtual environment of py27 and enter the following command:

Python-m ipykernel install -- user

Start jupyter notebook to view the information. You can see that the kernel of python2 has been installed.

Tips for Quick Start of jupyter notebook

When you start jupyter notebook, you need to switch the file path every time and enter related commands, which is relatively troublesome. There is a tips for quick start, which I usually use.

Under the folder path you want to open, create a file with the suffix ". bat" (for example, named ipy. bat), open the file in notepad, enter the following content and save it.

rem -- start_ipython_notebook_here.bat ---dirjupyter notebookpause

Double-click the ipy. bat file to start jupyter notebook quickly. I usually send this ipy. bat file to the desktop in a shortcut (pure lazy practices ~~).

Extended reading:

  1. Anaconda installs the virtual environment to the specified path

  2. Python Job Search top 10 cities to see if you have your city

  3. 5 minutes to learn how to crawl the Zhaopin website and save it to the MongoDB Database

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.