首页 > 编程语言 > 详细

Can I install Python 3.x and 2.x on the same Windows computer?

时间:2020-04-14 10:59:21      阅读:56      评论:0      收藏:0      [点我收藏+]
  1. nstall both Python 2.7 and 3.4 with the windows installers.
  2. Go to C:\Python34 (the default install path) and change python.exe to python3.exe
  3. Edit your environment variables to include C:\Python27\;C:\Python27\Scripts\;C:\Python34\;C:\Python34\Scripts\;

 

 

https://datascience.com.co/how-to-install-python-2-7-and-3-6-in-windows-10-add-python-path-281e7eae62a

1. Download python 2.7

Go to www.python.org/downloads and click on ‘Download Python 2.714”.

技术分享图片

Wait until installation package is complete.

技术分享图片

2. Install python 2.7

When download is finished click to install. You need to select a destination directory where python files and executables will be located. In my case I chose “C:\Python27” as my directory.

技术分享图片

Wait until install is complete.

技术分享图片

Click Finish

技术分享图片

3. Download python3

In the same way as described in step 1, download python3.

技术分享图片

Click on executable to install and choose ‘Customize installation’.

技术分享图片

Select default values and customize install location to C:\Python3

技术分享图片

4. Add python27 and python3 PATH

Search ‘Panel de control’ and open it.

技术分享图片

In the search bar, search for ‘variable de entorno’.

技术分享图片

Click on ‘Variables de entorno’

技术分享图片

Select PATH and click on ‘Nueva’

技术分享图片

Add the following routes in order to use python and pip.

C:\Python27

C:\Python27\Scripts

C:\Python3

C:\Python3\Scripts

Note: If you have installed python on a different location you need to find your where python is and set that location.

技术分享图片

5. Change executables names

In order to execute both python version change the python.exe to python2.exe where python2 is located and python.exe to python3.exe where python3 is located.

技术分享图片
技术分享图片
技术分享图片

Source: https://stackoverflow.com/questions/3809314/how-to-install-both-python-2-x-and-python-3-x-in-windows-7

6. TEST Both Python versions

a. Check python versions

Run Python2 –V and Python3 –V to get respective python versions.

技术分享图片

b. Install a package using python2 and python3

If the above commands run without problems python2 and python3 were successfully installed on windows 10 environment.

技术分享图片

Jose Miguel Arrieta

January 2018

Can I install Python 3.x and 2.x on the same Windows computer?

原文:https://www.cnblogs.com/kungfupanda/p/12695460.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!