472,146 Members | 1,219 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

default python when multiple python installation on the box

HI
I have multiple python installations. 2.2, 2.3, 2.4. When I install a
new package (pygtk2) , it always install in python 2.3.
I changed the /usr/bin/python to be 2.4 binary. Still the same behavior.
How does rpms, determine which installation to update ? Is there a
file somewhere ?
I am running in to this on Fedora as well as CenOS.

Thanks
/J
Oct 24 '06 #1
2 1450
j_nwb schrieb:
I have multiple python installations. 2.2, 2.3, 2.4. When I install a
new package (pygtk2) , it always install in python 2.3.
I changed the /usr/bin/python to be 2.4 binary. Still the same behavior.
How does rpms, determine which installation to update ? Is there a
file somewhere ?
I am running in to this on Fedora as well as CenOS.
Not sure what you mean by package: RPM package or distutils package?
If RPM package: binary package or source package?

Binary RPM packages have the Python version compiled into their
extension modules, and you can't change that without recompilation.
In addition, they have the directory and file names hard-coded in
the RPM archive.

Source RPM packages have the Python version coded into their spec
file. You should read the spec file to find out what Python version
it uses.

Distutils packages use the Python version you use to run setup.py,
so you should be able to install either with "python2.4 setup.py",
or get a different Python selected by changing /usr/bin/python.
Since you specifically asked about RPMs, I guess distutils packages
are of no interest to you, though.

Regards,
Martin
Oct 24 '06 #2
Does not help my immediate situation, but this understanding definitely
helps.
Thanks

/J

Martin v. Lwis wrote:
j_nwb schrieb:
> I have multiple python installations. 2.2, 2.3, 2.4. When I install a
new package (pygtk2) , it always install in python 2.3.
I changed the /usr/bin/python to be 2.4 binary. Still the same behavior.
How does rpms, determine which installation to update ? Is there a
file somewhere ?
I am running in to this on Fedora as well as CenOS.

Not sure what you mean by package: RPM package or distutils package?
If RPM package: binary package or source package?

Binary RPM packages have the Python version compiled into their
extension modules, and you can't change that without recompilation.
In addition, they have the directory and file names hard-coded in
the RPM archive.

Source RPM packages have the Python version coded into their spec
file. You should read the spec file to find out what Python version
it uses.

Distutils packages use the Python version you use to run setup.py,
so you should be able to install either with "python2.4 setup.py",
or get a different Python selected by changing /usr/bin/python.
Since you specifically asked about RPMs, I guess distutils packages
are of no interest to you, though.

Regards,
Martin
Oct 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

29 posts views Thread by Catalin | last post: by
11 posts views Thread by dmbkiwi | last post: by
4 posts views Thread by Logan | last post: by
3 posts views Thread by Matthias Baas | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.