Etch and Python 2.5

Need help with C, C++, perl, python, etc?

Postby Issyer » 2007-12-03 06:40

Compile python from source ./configure --prefix=/opt. It takes 5 minutes. Add to your .bashrc:
Code: Select all
export PATH

Code: Select all
$ python -V
Python 2.5.1
User avatar
Posts: 3054
Joined: 2007-05-23 02:59
Location: Khakassia

Postby codecraft » 2007-12-03 13:56

maybe we do something on the related issues
Posts: 6
Joined: 2007-10-25 02:10

Postby andmalc » 2008-01-24 20:15

viniosity wrote:Well, I stumbled on this thread b/c I have the same desire to use 2.5.1 instead of 2.4.4. I changed the symlink in /usr/bin and then tried creating a symlink for /usr/lib/python2.5 that pointed to /usr/lib/python2.4 (I moved my original folder out of the way temporarily).

For anyone still reading this ...

If you have installed your modules using Python's own package management system 'Easy Install', you can download module versions specifically for the Python version you're using. See here: ... n-versions

Easy Install is the best way to install Python modules for just a few machines. Installing through Debian's repos is better if you manage many machines as it is more automated.
Posts: 10
Joined: 2008-01-24 19:43

Postby flywitness » 2008-09-29 15:47

So thats it then? Are we concluding that Debian users must re-compile Python in order to get their site-packages into version 2.5?

Seems very strange to me. I would rather find another solution.
Posts: 2
Joined: 2008-07-11 17:30

Postby Issyer » 2008-09-29 16:15

flywitness wrote:I would rather find another solution.

There's one. It's called "ActivePython". It's already binaries and doesn't need to be compiled. ... ndex.mhtml
User avatar
Posts: 3054
Joined: 2007-05-23 02:59
Location: Khakassia

Postby arctan1701 » 2009-03-31 08:45

this will set your version properly with update-alternatives: ... in-debian/
Posts: 1
Joined: 2009-03-31 08:42


Postby killermonk » 2010-04-11 04:15

Lavene wrote:Thanks sinical, but it didn't quite work:
Code: Select all
/usr/bin# pycentral updatedefault python2.4 python2.5
Traceback (most recent call last):
  File "/usr/bin/pycentral", line 1373, in <module>
  File "/usr/bin/pycentral", line 1367, in main
    rv =
  File "/usr/bin/pycentral", line 1102, in run
    pkg.update_bytecode_files(runtimes, default_rt, bc_option)
  File "/usr/bin/pycentral", line 718, in update_bytecode_files
AttributeError: 'NoneType' object has no attribute 'byte_compile


I realize it has been several years since this topic was last touched, but since I found it and it was relevant to what I was doing. I will comment for anyone else who is behind the times and trying to do this.

The error encountered here is caused by "improper" symlinking for the /usr/bin/python. To default the "current" version of python running, does the following
Code: Select all
_default_version = os.readlink('/usr/bin/python')
return _default_version[6:]

It's not a very "intelligent" look up, but it makes the assumption that only the package manager is changing the location of the /usr/bin/python link.

My problem was that I did this:
sudo ln -sf /usr/bin/python2.5 /usr/bin/python

As such returns my default version as 'in/python2.5'. pycentral cannot find a match for this version and returns None. Then, when pyversions assumes that the default version is valid (it doesn't check), and tries to use it, it fails.

The solution:
cd /usr/bin
sudo ln -sf python2.5 python

So many hours for such a simple fix
Posts: 1
Joined: 2010-04-11 04:03


Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests