Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Managing two versions of Python on the same PC

I have a Windows PC and am running Python 3.4 for some time with all my code using this version. C:\Python34 and C:\Python34\Scripts are on my search path.

I want to use Google App Engine now but it seems that I will have to install Python 2.7.

I have no problems managing both versions manually for my own programs. But how about applications that run behind my back or under the covers, eg GAE, pip, etc? How would they know which or where the correct version will be?

Specifically, for GAE, can I continue to have Python 3.4 as the one with the option "Make this the Python installation the default Python installation"?

like image 682
Old Geezer Avatar asked Mar 03 '26 02:03

Old Geezer


1 Answers

For this purpose exists a "virtualenv" tool alias virtual enviroment. More HERE.

In short, you create a container (folder/enviroment) "A" with version 2.X and another container "B" with version 3.X and inside these containers will be all scripts executed by appropriate python interpreter which you have selected during creating these containers.

Official documentation of virtualenv is aimed to UNIX/Linux systems, so for you as WIN's user might be better (easier) to use "virtualenvwrapper-win". More HERE

like image 160
Yaaaaaaaaaaay Avatar answered Mar 05 '26 15:03

Yaaaaaaaaaaay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!