Python3 and Python3 coexist under windows

Source: Internet
Author: User

Under Linux, the alias command can be used to solve the coexistence problem of Python3 and python2, in fact, under Windows can also use this idea to solve the coexistence of python2 and Python3, but the steps are slightly cumbersome.

First set up a bat file to establish the corresponding relationship between aliases.

@doskey python3="c:\Users\Administrator\Anaconda3\python.exe" $*@doskey Ipython3 ="C:\Users\Administrator\Anaconda3\Scripts\ipython.exe" $*@doskey PIP3= " C:\Users\Administrator\Anaconda3\Scripts\pip.exe " $*

Where @doskey corresponds to the alias command in Linux, then the corresponding relationship between the command and the corresponding initiator path is specified. Focus on $*, which indicates that there may be parameters after the alias command.

The following need to modify the registry, each time you start cmd, automatically run the above script.

Under HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor, create a Autorun string value that specifies the path to the bat file above.

Enjoy it!

Python3 and Python3 coexist under windows

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.