Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How does one install Python3 on cygwin? I tried running the Python install in cygwin with no success.

The version I am looking for is >= 3.1, and I was able to install 2.7 successfully under cygwin (which comes with 2.6 as the default).

By the way, I would like to run Python3 as python3 and not python. I don't want conflicts with the default python binaries that come with cygwin.

Help!

share|improve this question

2 Answers 2

up vote 4 down vote accepted

As of yesterday (Wed 25 July 2012), Python 3.2.3 is included in the standard Cygwin installer. Just run Cygwin's setup.exe again (download it from cygwin.com again if you need to), and you should be able to select and install it like any other package.

This will still install as python3, leaving any existing 2.x install in place, just as before:

$ python -V
Python 2.6.8
$ python3 -V
Python 3.2.3
$ ls -l $(which python) $(which python3)
lrwxrwxrwx 1 me Domain Users 13 Jun 21 15:12 /usr/bin/python -> python2.6.exe
lrwxrwxrwx 1 me root         14 Jul 26 10:56 /usr/bin/python3 -> python3.2m.exe
share|improve this answer
    
brilliant! thanks for keeping the question in mind! –  eqb Jul 28 '12 at 19:35
    
can't vote up, not enough rep :( –  eqb Jul 28 '12 at 19:35
    
@ethiopianqubit you should be able to Mark this answer as accepted regardless of your rep, though - just click on the grey tick. –  me_and Jul 29 '12 at 11:06

You can do this using Cygwin Ports, a bunch of programs that have been ported to Cygwin, but aren't ready for general release.

From that page:

  1. Use the latest Cygwin setup.exe (at least version 2.738).
  2. Launch setup.exe with the -K flag, e.g.:

      cygstart -- /path/to/setup.exe -K http://cygwinports.org/ports.gpg
    
  3. On Choose Installation Type page, select "Install from Internet".

  4. On Choose Download Site(s) page, select a distro mirror, then enter ftp://ftp.cygwinports.org/pub/cygwinports in the User URL field and press Add (making sure that both are highlighted).
    • Mirrors are available by instead entering http://downloads.sourceforge.net/cygwin-ports as the User URL.
    • Alternatively, you can use a sourceware mirror, but if you do, you must use one hosted on a different server than your selected distro mirror.
  5. Proceed with package selection and installation, making sure to install any indicated dependencies.

Note that the two links provided didn't work for me; I'd expect FTP not to work as it's restricted by my firewall, but I think the alternative Sourceforge link is duff, and should be http://sourceforge.net/projects/cygwin-ports/files/. Using that URL worked fine for me.

From there, you should be able to select to install the python3 package. It's currently giving version 3.1.5rc1-1.

It does install as python3, leaving my existing python install as v2.6.8:

$ python -V
Python 2.6.8
$ python3 -V
Python 3.1.5rc1
$ ls -l $(which python) $(which python3)
lrwxrwxrwx 1 me root         13 Jun 12 13:43 /usr/bin/python -> python2.6.exe
lrwxrwxrwx 1 me Domain Users 13 Jun 19 10:51 /usr/bin/python3 -> python3.1.exe
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.