What is the correct way to install Python 3.0 alongside Python 2.x using Cygwin?
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.
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.
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 ".
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With