Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Python 3.0 on Cygwin

The Question

What is the correct way to install Python 3.0 alongside Python 2.x using Cygwin?

Notes

I already have a working copy of Cygwin, and Python 2.x is installed within Cygwin (/lib/python2.x, not c:\python2.x).

Also, I would like to be able to call python 3 separately (and only intentionally) by leaving python pointing to Python 2.x to preserve existing dependencies. I would like to use python30 or some alternative.

Any pointers to guides on the subject would be much appreciated. I cannot seem to find one either at the cygwin site or python.org.

like image 756
brad Avatar asked Jan 13 '09 20:01

brad


People also ask

How do I add Python to Cygwin?

The simplest way to install Python is to install the Python package right at the beginning of the Cygwin installation. Cygwin lets you choose among supported packages such as Ruby, PHP and Python. Once installed, invoke Python in Cygwin by typing "python -i" without the quotation marks.

Which packages to install in Cygwin?

You can install MinGW-W64 under "Cygwin" by selecting these packages (under "Devel" category): mingw64-x86_64-gcc-core : 64-bit C compiler for native 64-bit Windows. The executable is " x86_64-w64-mingw32-gcc ".


2 Answers

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 install as python3, leaving any existing 2.x install in place:

$ 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
like image 64
me_and Avatar answered Sep 18 '22 07:09

me_and


The standard make install target of the Python 3.0 sources doesn't install a python binary. Instead, make install prints at the end

* Note: not installed as 'python'.
* Use 'make fullinstall' to install as 'python'.
* However, 'make fullinstall' is discouraged,
* as it will clobber your Python 2.x installation.

So don't worry.

If you easily want to remove the entire installation, do something like configure --prefix=/usr/local/py3

like image 30
Martin v. Löwis Avatar answered Sep 22 '22 07:09

Martin v. Löwis