The default version of Python on Ubuntu 11.10 is 2.7, but I'm looking for 2.6. How do I make it default and where is the executable located?
I type which python2.6
but it returns nothing, yet I did have a python2.6 folder under /usr/lib/python2.6
. But it doesn't look like the python2.7 which is at the same path /usr/lib/
. Inside the python2.6, there are two folders: dist-packages
and lib-dynload
.
Actually I am configuring PyDev, and it requires me to specify where the python2.6 executable is. The python2.7 executable has been easily located by just using auto configuration as it is the default.
First, we change the current directory to the Downloads folder where we wish to download the package. This can be done by running the command below. The next step is to “wget” the package from the Python website. Click here to access the location from where you can select any version of Python of your liking.
You can install the package python2.6
(apt-get install python2.6
). At this point, the default version of Python will still be 2.7. You can change this via
ln -s /usr/bin/python2.6 /usr/bin/python
Note that there's a decent chance this could cause problems with your system. Several scripts assume the default version of Python is 2.7 and may break when run under a different version. If you have a script that explicitly requires Python 2.6, you can add a shebang at the beginning of your script to specify the version
#!/usr/bin/python2.6
On many systems, one version of python is the default. The rest get called by their name and version number:
~ $ python --version
Python 2.7.2
~ $ python2.6 --version
Python 2.6.7
Per the release notes, these should be available in Oneiric.
Your other questions:
$ which python2.6
to find out.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