Install Python2 and Python3 dual versions under Windows

Source: Internet
Author: User

Now common desktop operating systems are: Windows, Mac OS, Ubuntu, where Mac OS and Ubuntu will bring their own python. Here we only introduce the installation of python2.x and python3.x under the Windows (I-WIN10) environment, and the configuration issues when python2.x and python3.x coexist.

The content of this section
    1. Python download
    2. Install Python 2.x
    3. Install Python 3.x
    4. Existing problems
    5. Configuring environment variables for Python 2.x
    6. Distinguish between pyton2.x and Python 3.x related commands
    7. Test
    8. The choice of Python integrated development tools
First, Python download:

: www.python.org

This is the latest version of the current Python 2.x and Python 3.x installation package I downloaded

Second, install Python 2.x

Double-click Python-2.7.12.amd64.msi and then go all the way next.
It is important to note that Python 2.x is installed by default in the C packing directory, which is very easy to find, so we also recommend installing Python 3.x in the C packing directory.

Third, install Python 3.x

Choose a custom installation here because you want to modify the default installation location. Additionally, the "Add Python 3.5 to PATH" option is checked, and the environment variables are automatically configured, and Python 2.x needs to be configured manually, which is said below.

Check "Install for all users" here and customize the installation path to "C:\Python35"

Iv. Existing problems

It is known that only Python 3.x is configured in the current PATH environment variable, and the default Python command executes Python 3.x.

So there are two things we have to solve now:

    • Configure the environment variables for Python 2.x;
    • To distinguish the relevant commands for Python 2.x and Python 3.x;
V. Configure the environment variables for Python 2.x;

Here you need to add two directories to the PATH environment variable:

    • python command file directory: python 2.x installation directory
    • The directory where other script files such as Pip, Easy_install, etc. are located: The Scripts directory in the Python 2.x installation directory

How to: Right-click My Computer/This computer--properties--Advanced system settings--Advanced tab (default)--Environment variables---------

Add the following line to the beginning of the PATH variable:
C:\Python27; C:\Python27\Scripts;

The last is this:

Six, the Python 2.x and Python 3.x related commands to separate;

The solution is to add a 3 after all command file names under Python 3.x, such as: Python ==> python3

Seven, test:

Note: Be sure to restart the command terminal, otherwise the path variable will not be reloaded.

Test found PIP3 problem, in fact, the PIP version is too low, upgrade it: python3-m pip install-u pip

Everything seems OK!

Important NOTE:

A lot of friends in the blog under the message that this step is not successful or ineffective, because everyone's computer environment is different, I can not specifically determine the real cause of the problem. One of the friends feedback manually download a new version of the PIP on it, you may wish to follow this friend's practice, the specific steps can refer to the article

Eight, the choice of integrated development tools

The Ancients Cloud "工欲善其事, its prerequisite", choose a suitable development tool, can help us to improve work efficiency. There are usually several tools to choose from:

    • Pure File Tool : No prompt, completely need to manually write code, compile and run also need to be done manually, such as Notepad;
    • simple GUI Development tools : There are simple hints, but the compilation and operation still need to be done manually, such as notepad++;
    • Advanced GUI Tools : Prompt, and compile and run processes are automatically completed by the development tools, such as Eclipse, Pycharm

Some people think that when you start learning a programming language, you should use simple tools such as Notepad or notepad++ to reduce the reliance on advanced GUI development tools, so that you can more clearly understand the underlying operating procedures and principles of the language that is blocked by the development tools. But this is still personal, for example, I think a novice has just started to use without any hint of development tools will reduce the effectiveness of the exercise, and even further combat confidence and learning motivation. It is difficult to learn it well in the future if you are afraid of it from the beginning.

Of course, the choice is still up to crossing, the recommended GUI tool for developing Python is pycharm, for the following reasons:

    • Cross-platform , basically now commonly used desktop operating system has the corresponding version can be downloaded
    • divided into community and commercial editions , the Community edition is free to use, but features will be less (completely enough for beginners); The business edition is full-featured, but requires a fee.

Pycharm 2017 Activation Code

Big3clik6f-eyjsawnlbnnlswqioijcsuczq0xjszzgiiwibgljzw5zzwvoyw1lijoibgfuihl1iiwiyxnzawduzwvoyw1lijoiiiwiyxnzawduzwvfbwfpbc I6iiisimxpy2vuc2vszxn0cmljdglvbii6ikzvciblzhvjyxrpb25hbcb1c2ugb25sesisimnozwnrq29uy3vycmvudfvzzsi6zmfsc2usinbyb2r1y3rzijp Beyjjb2rlijoiqumilcjwywlkvxbubyi6ijiwmtctmtetmjmifsx7imnvzguioijetsisinbhawrvcfrvijoimjaxny0xms0ymyj9lhsiy29kzsi6ikljiiwi Cgfpzfvwvg8ioiiymde3ltexltizin0seyjjb2rlijoiulmwiiwicgfpzfvwvg8ioiiymde3ltexltizin0seyjjb2rlijoiv1milcjwywlkvxbubyi6ijiwm Tctmtetmjmifsx7imnvzguioijeue4ilcjwywlkvxbubyi6ijiwmtctmtetmjmifsx7imnvzguioijsqyisinbhawrvcfrvijoimjaxny0xms0ymyj9lhsiy2 9kzsi6ilbtiiwicgfpzfvwvg8ioiiymde3ltexltizin0seyjjb2rlijoiremilcjwywlkvxbubyi6ijiwmtctmtetmjmifsx7imnvzguioijeqiisinbhawr Vcfrvijoimjaxny0xms0ymyj9lhsiy29kzsi6iljniiwicgfpzfvwvg8ioiiymde3ltexltizin0seyjjb2rlijoiuemilcjwywlkvxbubyi6ijiwmtctmtet Mjmifsx7imnvzguioijdtcisinbhawrvcfrvijoimjaxny0xms0ymyj9xswiagfzaci6ijq3nzu1mtcvmcisimdyywnlugvyaw9krgf5cyi6mcwiyxv0b1byb 2xvbmdhdGVkIjpmYWxzZSwiaXNBdXRvUhjvbg9uz2f0zwqiomzhbhnlfq==- Iygsimxtvesyykuxaqphmymrgwn5inkoferhhpipa88fo9fruzosibty18tflchacznk3qfert7imgkm7pumdtr4fbvvlk/3n1er0emku2ncaxb7m10xt6klw1xb3ltuzenuis5pyuewt1zr7gskenwdyz0dajpndlfrqpyapo5s1kldhkpw+vfvd4uf7rmjoizujhaayag+ Amyivqt61i9ayiwphqvuphvtwi0x0ql/odjhaqbiv4qwscyo4ayzjbkutyiozh9rgop6yw/scltpopwljtdocw/iewyicvg1ph9awjcyxz9abbebowv71iqr5vwrsqfz7cg7hlej3a==- Miiepjccaiagawibagibbtanbgkqhkig9w0baqsfadaymrywfaydvqqdda1kzxrqcm9mawxlienbmb4xdte1mtewmja4mje0ofoxdte4mtewmta4mje0ofowe tepma0ga1ueawwgchjvzdn5miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqeaxcqkq+ Zdxlr2mmrybpzgbundmn6oaxixzxiwtmekrjmo/5oufqjbllumsmk0qhfmai37wshyxzcfrcidwxjot4zmnbknlyhoddij/78tmvqfl8noed5+07b8veaiu7c3e1n+e1doc6wht4i4+iemtspadoaj5wcqvqbri8ket8m9vcbiwx7fd0fhexfg3zrt0xqwmcxgnp3ddjhio0rcdu+ Itv7emtnsvq9jbg1usmsfvmowr25mju2jcpfp1+i4zi+fqgr8gyg8oindyneoabsr3lopi7gruysvkb/xvy/voklpck2h0f0gjxfjnye8nt1paywoyl7rmiavre/ekwidaqabo4gzmigwmakga1udewqcmaawhqydvr0obbyefgepg9ozgcflmgnbky7sghimggtcmegga1udiwrbmd+ afkoetkhnqhi2qb1t4lm0ofkll/ Gzorykgjaymrywfaydvqqdda1kzxrqcm9mawxlienbggka0myxg7kdeeewewydvr0lbawwcgyikwybbquhawewcwydvr0pbaqdagwgma0gcsqgsib3dqebcwu Aa4icaqc9wzuygqedsuoc5tousrrigmw4/+wuc5etzbfvdl4ht/8vzmw/ oulip4ycva0xkybacj2ix+zcdkopfiyxiasih+hxapv6j79vvouxkrwg2xv6shftplp+0gpdgq3x9r3+kjbmam8w+ Fodlwqafjrlvpzmgnedu14ygxiz9bvzmiqbwrba+c/f4tlk/ dv07dsnexihqfoibnqdivntgombau2ddup2gwkdl81ua8eicgnexhe82kjf4zwfadhk3bqvvbfdawxcdy4xbjs3l4raplu3yenszr/oeur1+ Jfoxnqsmecmxkxgraq9u55gwjcofkrgoxedek/sk1vfojvs+ num4eyerufmfazhzoqiuw4iqggc45ohfh0uuyjycufxxdsu9lmcv8qdhkm+wnprb0l9l5vxscbduhagyd6ss+ga+ady6f/ Qxzuuceuoh3qunbbculvisz6+girnt1ka9n2qachl+ 2ybfaquqr8h7z2gsx5lcif5kynsqj0gavxtvywh7pyikx4bs354zqluwwa/cg++2+wNWP+ htbhvxmrntdvhsm38aknzld+ptaswgu9gylmhti2envwgybsd2dxmhxk3ipckhkak+ pl0ewygzwg3tj9mz7sowcxlwdfak0lrjnkgfmtggrwjv8gypw5bq23vmiqqdlgknzuoog== 



Excerpt: https:// www.cnblogs.com/yyds/p/6080826.html

Installing Python2 and Python3 versions 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.