I have discussed installing multiple python versions under anaconda before. In this issue, we will discuss how to install python2.7 and python3.x at the same time in jupyter notebook.
Since the jupyter notebook I used before was based on the python3.5 version, I only need to install the python2.7-based kernel on this basis.
My environment is as follows:
-
windows 7, 64-bit system
-
Anaconda based on python3.5 version has been installed
-
The virtual environments of py27 and py36 have been installed in anaconda
-
The existing jupyter notebook kernel is based on the python3.5 version
Install the py27 kernel based on the py35 kernel
In jupyter notebook, select a different python version, called kernel. When installing, just install ipykernel.
In the previous article, I installed anaconda's virtual environment py27 in the specified path (D:\pyenv\py27), so when installing ipykernel, I also need to specify the installation. The installation command is "conda install --prefix=D:\pyenv\py27 ipykernel", as follows:
Then activate the virtual environment of py27 and enter the command:
python -m ipykernel install --user
When starting jupyter notebook, you have to switch the file path every time and enter relevant commands, which is relatively troublesome. There is a little trick that can be used to start quickly. This is what I usually use.
In the path of the folder you want to open, create a file with the suffix ".bat" (for example, named ipy.bat), open the file with Notepad, enter the following content and save it.
rem -- start_ipython_notebook_here.bat ---<span style="color: #000000;"> dir jupyter notebook pause</span>
Extended reading:
- Anaconda installs the virtual environment to the specified path
- Top 10 cities for python job hunting, let’s see if your city is included
- 5 minutes to master Zhaopin recruitment website crawling and saving to MongoDB database
The above is the detailed content of Install both python2 and python3 in jupyter notebook. For more information, please follow other related articles on the PHP Chinese website!

LeicareleasedtheLeicaLuxcameraappfortheAppleiPhoneafewdaysago.However,theappwasnotdevelopedbyLeica,butbyFjorden.ThecompanyhasbeenknownprimarilyforitscameragripsfortheiPhoneandwasacquiredbyLeicainDecember2023.Fo

SincethedemiseofLogitech'spopularHarmonyremotecontrols,themarketforhigh-qualityuniversalremotecontrolshasbeenfragmentedatbest.UnfoldedCircleaimstoavoidthefateoftheHarmonyUltimatebyeliminatinganyserverobligationsorsubs

Anintriguingthird-partycasefortheGalaxyS24Ultra(curr.$1,099.99onAmazon)hasappearedonmarketplaceslikeAliExpress.Astheimagesthroughoutthisarticleshow,thecasehasasimplesiliconeconstruction.However,italsocontainsanEInkd

WhiletheLightPhone2from2018wasstillequippedwithaneconomicale-inkdisplay,theLightPhone3usesanOLEDdisplaythatcanonlydisplaygrayscale.Thereasonfortheswitchtothe3.92-inchOLEDpanelwithitsresolutionof1,240x1,080isth

In2012,theeminentautomotivejournalistJeremyClarksonstatedthattheLamborghiniAventador,whichhewasreviewingatthetime,wouldbeamongthelastcarstofeatureanaturallyaspiratedV12.Morethanadecadelater,V12-poweredsupercarsareal

Audio-TechnicahasunveiledtheATH-S300BTwirelessheadphoneswithhear-throughnoise-cancellation,multipointpairing,and90hoursofbatterylife.Thenoise-cancellingfeaturehasthreemodes:off,on,andhear-through,whereambientsoundscanbehea

TheJabraEliteserieshascometoanend,withGNCEOPeterKarlstromerannouncingthediscontinuationofthewirelessearbudswithinthelineupinapressrelease.Petersaysthatthechangingmarketdynamicsandhowchallengingithasbecometogetas

Backin2022,whenPCIe7.0wasstartingtotakeshapeasafuturestandard,PCIe5.0wasjusthittingtheservermarketsandtheprospectofseeingPCIe6.0devicesavailableanytimesoon,letalonePCIe7.0ones,wasquitefar-fetched.CurrentlyPCIe5


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
