[Tutor] Installing both Python 2.7 and Python 3.4 on Windows 7 Pro 64-bit: Install Python 2.7 FIRST! (boB Stepp)

Dino Bektešević ljetibo at gmail.com
Fri Oct 10 09:24:41 CEST 2014


In the lieu of the same thing. I did an install of both python 2.6 and
3.3 on Win7.
The key was to start using virtualenv
(http://docs.python-guide.org/en/latest/dev/virtualenvs/) and set it
up to the python install of my choice with:

virtualenv -p /usr/bin/python2.7 venv

although virtualenv has somewhat mixed reviews, some say it's good
some don't really like it, I find that it makes handling of python
versions really easy and I do recommend it.
Upsides are: clean enviroment every time, you get to use pip even in Win.

Downsides: sometimes is a bugger to install. You want to isolate each
virtualenv by not using local packages, that means for each virtual
env you want to install all the packages from scratch, but some
packages don't really want to install easily in virtualenv (matplotlib
I'm looking at you!). The --relocatable flag to can be a real
nightmare, don't know if they fixed it as of recently....

As far as it goes without virtualenv, it's best to structure your code
so that it's terminal friendly even in Win, and then start each with

C:\python2.6\python program.py

or whatever your full path may be.


> ------------------------------
>
> Message: 7
> Date: Thu, 9 Oct 2014 22:57:24 -0500
> From: boB Stepp <robertvstepp at gmail.com>
> To: tutor <tutor at python.org>
> Subject: [Tutor] Installing both Python 2.7 and Python 3.4 on Windows
>         7 Pro 64-bit: Install Python 2.7 FIRST!
> Message-ID:
>         <CANDiX9LG2y7XNGLsruqjNtY7GZYN5VWEm-E2sha1o0LLqB2Xsw at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I am hoping to save other people the grief I just worked through. I
> wanted to run both Python 2 and 3 on my windows PC, and, after
> googling this topic found that with Python 3.3 or later one could
> easily do both. So I merrily installed Python 3.4.2 first and then
> Python 2.7.8. A Python 3 program that had been working fine suddenly
> stopped working. After working down to a test portion of code that
> isolated the culprit I realized my Python 3 program was being
> interpreted by Python 2. I soon found that installing Python 2 first
> and then 3 enabled both to happily coexist. If there was a mention
> about the order of installation anywhere during my searches, I missed
> it. Anyway, I hope that my experience helps some other newbie who
> wants to play around with both major versions.
>
> --
> boB
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> https://mail.python.org/mailman/listinfo/tutor
>
>
> ------------------------------
>
> End of Tutor Digest, Vol 128, Issue 22
> **************************************


More information about the Tutor mailing list