Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Etch and Python 2.5
Etch and Python 2.5
I want to upgrade Python in Etch and make 2.5 the default. I installed it through apt and it works nicely. So far so good... But how do I make it the default version and how do I get all my extra modules 'imported' to 2.5?
I guess I can change the 'python' link in /usr/bin to point to 2.5 and copy /usr/lib/python2.4/site-packages to /usr/lib/python2.5/site-packages but this feels a bit too hackish. Am I missing something here?
Tina
I guess I can change the 'python' link in /usr/bin to point to 2.5 and copy /usr/lib/python2.4/site-packages to /usr/lib/python2.5/site-packages but this feels a bit too hackish. Am I missing something here?
Tina
Yeah you hacked it
Edit /usr/share/python/debian_defaults to this
And change the symlink /usr/bin/python to point to python2.5
Edit: And then run
Should output something similar to
Python 2.5.1
Edit: Formatting fubar
Edit /usr/share/python/debian_defaults to this
Code: Select all
[DEFAULT]
# the default python version
default-version = python2.5
# all supported python versions
supported-versions = python2.4, python2.5
# formerly supported python versions
old-versions = python2.3
# unsupported versions, including older versions
unsupported-versions = python2.3
Edit: And then run
Code: Select all
sudo pycentral updatedefault python2.4 python2.5
Code: Select all
python -V
Should output something similar to
Python 2.5.1
Edit: Formatting fubar
Every cloud has a silver lining, except for the mushroom shaped ones, which have a lining of Strontium 90.
---------------------------------------------
umop apisdn
---------------------------------------------
umop apisdn
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>
main()
File "/usr/bin/pycentral", line 1367, in main
rv = action.run(global_options)
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
self.default_runtime.byte_compile(self.private_files,
AttributeError: 'NoneType' object has no attribute 'byte_compile
Code: Select all
# python -V
Python 2.5
# LANG=C apt-cache policy python2.5
python2.5:
Installed: 2.5-5
Candidate: 2.5-5
Version table:
2.5.1-1 0
500 ftp://ftp.no.debian.org testing/main Packages
500 ftp://ftp.no.debian.org unstable/main Packages
*** 2.5-5 0
990 ftp://ftp.no.debian.org etch/main Packages
100 /var/lib/dpkg/status
# python
Python 2.5 (release25-maint, Dec 9 2006, 14:35:53)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4
>>>
Code: Select all
sudo aptitude install pyqt4-dev-tools python-qt4-dev
Is PyQt4 in /usr/lib/python2.5/site-packages ?python -V
Python 2.5.1
sinical@arcturus:/usr/lib/python2.5/site-packages$ python
Python 2.5.1 (r251:54863, Apr 25 2007, 22:53:30)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
>>>
Every cloud has a silver lining, except for the mushroom shaped ones, which have a lining of Strontium 90.
---------------------------------------------
umop apisdn
---------------------------------------------
umop apisdn
AFAIK (I am *really* new to using python) you can copy the site-packages from /usr/lib/python2.4 to /usr/lib/python2.5
The problem is the compiled .pyc files - but again .. afaik they are automagically recompiled as needed
The problem is the compiled .pyc files - but again .. afaik they are automagically recompiled as needed
Every cloud has a silver lining, except for the mushroom shaped ones, which have a lining of Strontium 90.
---------------------------------------------
umop apisdn
---------------------------------------------
umop apisdn
update-alternatives
You can change the default python version through Debian's update-alternatives system.
Just run this command as root:
`update-alternatives --config python'
Then choose the number in the menu that has the version you would like to be default. This also works for text editors, web browsers, and and pretty much any instance where you have multiple versions of the same application installed. See `man update-alternatives' for more details.
Just run this command as root:
`update-alternatives --config python'
Then choose the number in the menu that has the version you would like to be default. This also works for text editors, web browsers, and and pretty much any instance where you have multiple versions of the same application installed. See `man update-alternatives' for more details.
uh-huh spits out
Code: Select all
sudo update-alternatives --display python
No alternatives for python.
Every cloud has a silver lining, except for the mushroom shaped ones, which have a lining of Strontium 90.
---------------------------------------------
umop apisdn
---------------------------------------------
umop apisdn
I have no alternatives set up for Python, besides making 2.5 the default is not the problem, the problem is to bring with me all extra modules I have installed (which is located in /usr/lib/python2.4/site-packages)Just run this command as root:
`update-alternatives --config python'
But I'll try to just copy it over...
Tina
-
- Posts: 63
- Joined: 2007-08-11 13:32
- Location: London SE
Etch and Python 2.5
I think I have followed matters thus far, but sadly I'm no nearer making Python 2.5 the default - when I ran the "config" command mentioned here I got the famous TINA answer: "there is no alternative". All I want to do is run Gramps properly -
TIA wayzgooser
TIA wayzgooser
-
- Posts: 63
- Joined: 2007-08-11 13:32
- Location: London SE
Etch and Python 2.5
I have read elsewhere and with some care, which has brought me to the understanding that there's nothing wrong with having versions 2.4 and 2.5 of Python installed in the same kit. The only difference seems to be that Python 2.5 is "unsupported". By Debian, I assume. So is it that one MUST install the "unstable" version of Debian? Or am I being quietly urged not to run Gramps? I puzzle on ...
I'd appreciate some guidance.
wayzgooser
I'd appreciate some guidance.
wayzgooser
What you have done here is called "hijacking a thread." You have tacked your unrelated question on the end of someone else's issue. It is considered very impolite, and often means that it will simply be ignored. Start a new thread addressing your own issue. Something like, "Gramps won't work on Etch because it requires Python2.5." It would probably be better off in the "General Questions" forum.I'd appreciate some guidance.
Debian-Lenny/Sid 32/64
Desktop: Generic Core 2 Duo, EVGA 680i, Nvidia
Laptop: Generic Intel SIS/AC97
Desktop: Generic Core 2 Duo, EVGA 680i, Nvidia
Laptop: Generic Intel SIS/AC97
-
- Posts: 63
- Joined: 2007-08-11 13:32
- Location: London SE
Etch and Python 2.5
It seems I have erred. Point(s) taken - I shall away to other headings - with apologies.
Wayzgooser
Wayzgooser
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).
Unfortunately, some things (notably Compiz's fusion-icon) didn't work when I did that. So I'm led to believe that just copying over the contents of your site-packages won't do the trick. Maybe I'm wrong and missed a step - would love to know. Otherwise it's back to the drawing board.
Unfortunately, some things (notably Compiz's fusion-icon) didn't work when I did that. So I'm led to believe that just copying over the contents of your site-packages won't do the trick. Maybe I'm wrong and missed a step - would love to know. Otherwise it's back to the drawing board.
Compile python from source ./configure --prefix=/opt. It takes 5 minutes. Add to your .bashrc:
Code: Select all
PATH=/opt/bin:$PATH
export PATH
Code: Select all
$ python -V
Python 2.5.1
For anyone still reading this ...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).
...
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:
http://peak.telecommunity.com/DevCenter ... 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: 2
- Joined: 2008-07-11 17:30
There's one. It's called "ActivePython". It's already binaries and doesn't need to be compiled.flywitness wrote:I would rather find another solution.
http://www.activestate.com/Products/act ... ndex.mhtml