FAQ
I can install Python 2.4 on the Fedora 3 Linux system, but after I do a
number of Linux utilities and commands, like yum, stop working because
they were dependent on the Python 2.3 installation. What happens is that
Python 2.4 replaces the /usr/bin/python module with the Python 2.4
version. If I replace /usr/bin/python with the Python 2.3 version
executable, which is still on my system, that all the aforesaid modules
depend on, they start working again, but I can no longer execute
modules, like IDLE, which was part of my Python 2.4 distribution.

What is the solution to this ? The operating system was installed with
Python 2.3 and the development libraries but no tools, doc, or
otherwise. I have installed Python 2.4 with all the RPMs and copied down
the Python 2.4 documentation to my machine ( since python24-docs.rpm
gives one very little ). I would naturally like to use Python 2.4
without killing all the commands that depend on Python 2.3. No doubt
these commands have their modules in the site libraries for Python 2.3.
Of course I would love to update these dependencies to use Python 2.4
but newer RPMs for these commands do not exist.

I do not know whether this is a Python problem or a Fedora 3 problem but
I thought I would ask here first and see if anybody else had the same
problem. I imagine the problem might exist on other Linux systems.

Search Discussions

  • Marcin Stępnicki at Apr 5, 2005 at 10:59 pm

    Dnia Tue, 05 Apr 2005 21:21:37 +0000, Edward Diener napisal(a):

    I can install Python 2.4 on the Fedora 3 Linux system, but after I do a
    number of Linux utilities and commands, like yum, stop working because
    they were dependent on the Python 2.3 installation. What happens is that
    Python 2.4 replaces the /usr/bin/python module with the Python 2.4
    version. If I replace /usr/bin/python with the Python 2.3 version
    executable, which is still on my system, that all the aforesaid modules
    depend on, they start working again, but I can no longer execute
    modules, like IDLE, which was part of my Python 2.4 distribution.

    What is the solution to this ? The operating system was installed with
    Python 2.3 and the development libraries but no tools, doc, or
    otherwise. I have installed Python 2.4 with all the RPMs and copied down
    the Python 2.4 documentation to my machine ( since python24-docs.rpm
    gives one very little ). I would naturally like to use Python 2.4
    without killing all the commands that depend on Python 2.3. No doubt
    these commands have their modules in the site libraries for Python 2.3.
    Of course I would love to update these dependencies to use Python 2.4
    but newer RPMs for these commands do not exist.

    I do not know whether this is a Python problem or a Fedora 3 problem but
    I thought I would ask here first and see if anybody else had the same
    problem. I imagine the problem might exist on other Linux systems.
    It's rather Fedora related, I have Python 2.2, 2.3 and 2.4 on my Ubuntu
    box and they seem to coexist without problems.

    If you can afford breaking package dependencies a bit, save a copy of
    python2.3 binary somewhere and recreate it after installing Python 2.4,
    OR make a symbolic link /usr/bin/python to /usr/bin/python2.3 and use
    /usr/bin/python2.4 explicitely when you want to use the newer version. You
    may also try to link modules from /usr/lib/python2.3/site-packages to
    /usr/lib/python2.4/site-packages (all or just few of them) - most should
    be upwards compatible. It may make Fedora utilities work again
    (you haven't provided error messages, so it's hard to tell) even with
    Python 2.4.

    --
    Przed siebie idziesz i zabijasz | http://apcoln.linuxpl.org
    Nic nie czujac w serce sztylet wbijasz | http://biznes.linux.pl
    ----------------------------------------| http://www.juanperon.info
    JID: Aragorn_Vime at jabber.org | http://www.naszedzieci.org
  • Edward Diener at Apr 6, 2005 at 2:33 am

    Marcin St?pnicki wrote:
    Dnia Tue, 05 Apr 2005 21:21:37 +0000, Edward Diener napisal(a):
    I can install Python 2.4 on the Fedora 3 Linux system, but after I
    do a number of Linux utilities and commands, like yum, stop working
    because they were dependent on the Python 2.3 installation. What
    happens is that Python 2.4 replaces the /usr/bin/python module with
    the Python 2.4 version. If I replace /usr/bin/python with the Python
    2.3 version executable, which is still on my system, that all the
    aforesaid modules depend on, they start working again, but I can no
    longer execute modules, like IDLE, which was part of my Python 2.4
    distribution.

    What is the solution to this ? The operating system was installed
    with Python 2.3 and the development libraries but no tools, doc, or
    otherwise. I have installed Python 2.4 with all the RPMs and copied
    down the Python 2.4 documentation to my machine ( since
    python24-docs.rpm gives one very little ). I would naturally like to
    use Python 2.4 without killing all the commands that depend on
    Python 2.3. No doubt these commands have their modules in the site
    libraries for Python 2.3. Of course I would love to update these
    dependencies to use Python 2.4 but newer RPMs for these commands do
    not exist.

    I do not know whether this is a Python problem or a Fedora 3 problem
    but I thought I would ask here first and see if anybody else had the
    same problem. I imagine the problem might exist on other Linux
    systems.
    It's rather Fedora related, I have Python 2.2, 2.3 and 2.4 on my
    Ubuntu box and they seem to coexist without problems.

    If you can afford breaking package dependencies a bit, save a copy of
    python2.3 binary somewhere and recreate it after installing Python
    2.4
    After I installed Python 2.4, the Python 2.3 executable still existed on the
    system. So the only difference which occurred is that the Python 2.4
    installation copied to the /usr/bin/python executable the /usr/bin/python2.4
    executable ( it would seem more understandable that /usr/bin/python be a
    link instead ). So there is really no need to recreate it. Essentially the
    two versions co-exist on the system but only one can be /usr/bin/python and
    therefore executed when a Python script is is used as a command.
    , OR make a symbolic link /usr/bin/python to /usr/bin/python2.3
    and use /usr/bin/python2.4 explicitely when you want to use the newer
    version.
    Yes, this is the right solution. I am so used to just executing a Python
    script that I forgot that I could just say 'python2.4 ascript.py'.
    You may also try to link modules from
    /usr/lib/python2.3/site-packages to /usr/lib/python2.4/site-packages
    (all or just few of them) - most should be upwards compatible.
    By link do you simply mean moving the unique modules in the site packages
    from the python2.3 directory to the python2.4 site-packages directory, or is
    there something else I must do to see if they work ?
    It may
    make Fedora utilities work again (you haven't provided error
    messages, so it's hard to tell) even with Python 2.4.
    The errors when executed from the command line, when python2.4 is python,
    involved not being able to find modules, no doubt because they were not in
    the python2.4 site-packages subdirectory. When python2.3 is python, the
    modules are found and everything works. Maybe it is just a matter of moving
    of copying these modules on over and seeing if that fixes things. Do
    site-packages have to "register" themselves in any way during setup ? I do
    not think so, but I may be wrong.
  • Simon John at Apr 6, 2005 at 3:47 am

    Marcin Stepnicki wrote:

    It's rather Fedora related, I have Python 2.2, 2.3 and 2.4 on my Ubuntu
    box and they seem to coexist without problems.
    It's not a Fedora problem at all.

    The 2.4.1 RPM's just move the default /usr/bin/python symlink to point
    to the new Python24 instead of Python23 that is the system default. You
    can move it back and then just point to it in the shebang in your
    scripts (#!/usr/bin/python24)

    Or you could compile 2.4 from source as I did, then you won't need to
    change symlinks, just install it in /usr/local/bin/python24 or
    something. I prefer this method, as it means you can have a seperate
    2.4 install of wxPython etc (just change the LD_LIBRARY_PATH).
  • John Ridley at Apr 5, 2005 at 11:33 pm
    --- Edward Diener wrote:
    [snip]
    I do not know whether this is a Python problem or a Fedora 3 problem
    but
    I thought I would ask here first and see if anybody else had the same

    problem. I imagine the problem might exist on other Linux systems.
    On my Mandrake 10.1 system I have the default python 2.3 installation
    plus a separate python 2.4 installation which I compiled from source.
    There are two executables (python2.3 and python2.4) in /usr/bin, plus a
    hard-link (from python2.4) named python. If necessary, I could switch
    back to the default setup by replacing the hard-link with one from
    python2.3 - so the system would then have its preferred python version
    and I could selectively run python2.4 whenever appropriate. So far,
    Mandrake has not complained about using python 2.4 exclusively, so I
    might try removing the old installation eventually. (Then again, it's
    always handy to keep it for compatibility testing).

    Note that if compiling and installing from source there is an option of
    'make altinstall' which will leave the existing python executables (and
    man pages) as they are and just create a new python2.4 executable - by
    default the library is installed in '/usr/local/lib/python2.4'. See the
    README for details.


    John Ridley

    Send instant messages to your online friends http://uk.messenger.yahoo.com
  • David Fraser at Apr 6, 2005 at 6:59 pm

    Edward Diener wrote:
    I can install Python 2.4 on the Fedora 3 Linux system, but after I do a
    number of Linux utilities and commands, like yum, stop working because
    they were dependent on the Python 2.3 installation. What happens is that
    Python 2.4 replaces the /usr/bin/python module with the Python 2.4
    version. If I replace /usr/bin/python with the Python 2.3 version
    executable, which is still on my system, that all the aforesaid modules
    depend on, they start working again, but I can no longer execute
    modules, like IDLE, which was part of my Python 2.4 distribution.

    What is the solution to this ? The operating system was installed with
    Python 2.3 and the development libraries but no tools, doc, or
    otherwise. I have installed Python 2.4 with all the RPMs and copied down
    the Python 2.4 documentation to my machine ( since python24-docs.rpm
    gives one very little ). I would naturally like to use Python 2.4
    without killing all the commands that depend on Python 2.3. No doubt
    these commands have their modules in the site libraries for Python 2.3.
    Of course I would love to update these dependencies to use Python 2.4
    but newer RPMs for these commands do not exist.

    I do not know whether this is a Python problem or a Fedora 3 problem but
    I thought I would ask here first and see if anybody else had the same
    problem. I imagine the problem might exist on other Linux systems.
    Actually the Fedora RPMS supplied on the Python website are fine:
    http://www.python.org/2.4.1/rpms.html
    Quoting from that page:
    # Q) Is it safe to install these RPMs on a Red Hat system? Will they over-write the system python and cause problems with other Red Hat applications that expect a different version of Python?
    # A) The RPMs that start with "python2.4" are built to not interfere with the system Python. They install as "/usr/bin/python2.4" and will not conflict with the system Python unless you are running on a system that ships the a version of Python which has the same major/minor number.

    To invoke the interpreter with these packages, you will explicitly have to run "python2.4". Note that all Python RPMs provided by Python.org and Red Hat provide a "/usr/bin/python2.4" (or similar, with major/minor number), even if they also provide "/usr/bin/python". So, yes, it should be safe.

    Note that you may need to build and install a second copy of any packages which you need access to with the supplemental version of Python. You can build packages of these files for the Python 2.4 interpreters for packages which use Distutils, by using the command "python2.4 setup.py bdist_rpm".
    This is by far the preferred way to install a different version of
    Python to the default version provided with a distribution, as you don't
    then conflict with packages that require the default version.

    Also, it is better to do it like this using real packages than to rename
    files manually. I have used the above successfully on Fedora Core 3 (and
    other similar versions on other distro versions), if it doesn't work for
    you there is a source RPM available to rebuild from

    Hope that helps
    David
  • Edward Diener at Apr 8, 2005 at 4:34 pm

    David Fraser wrote:
    Edward Diener wrote:
    I can install Python 2.4 on the Fedora 3 Linux system, but after I do
    a number of Linux utilities and commands, like yum, stop working
    because they were dependent on the Python 2.3 installation. What
    happens is that Python 2.4 replaces the /usr/bin/python module with
    the Python 2.4 version. If I replace /usr/bin/python with the Python
    2.3 version executable, which is still on my system, that all the
    aforesaid modules depend on, they start working again, but I can no
    longer execute modules, like IDLE, which was part of my Python 2.4
    distribution.

    What is the solution to this ? The operating system was installed with
    Python 2.3 and the development libraries but no tools, doc, or
    otherwise. I have installed Python 2.4 with all the RPMs and copied
    down the Python 2.4 documentation to my machine ( since
    python24-docs.rpm gives one very little ). I would naturally like to
    use Python 2.4 without killing all the commands that depend on Python
    2.3. No doubt these commands have their modules in the site libraries
    for Python 2.3. Of course I would love to update these dependencies to
    use Python 2.4 but newer RPMs for these commands do not exist.

    I do not know whether this is a Python problem or a Fedora 3 problem
    but I thought I would ask here first and see if anybody else had the
    same problem. I imagine the problem might exist on other Linux systems.

    Actually the Fedora RPMS supplied on the Python website are fine:
    http://www.python.org/2.4.1/rpms.html
    Quoting from that page:
    # Q) Is it safe to install these RPMs on a Red Hat system? Will they
    over-write the system python and cause problems with other Red Hat
    applications that expect a different version of Python?
    # A) The RPMs that start with "python2.4" are built to not interfere
    with the system Python. They install as "/usr/bin/python2.4" and will
    not conflict with the system Python unless you are running on a system
    that ships the a version of Python which has the same major/minor number.

    To invoke the interpreter with these packages, you will explicitly
    have to run "python2.4". Note that all Python RPMs provided by
    Python.org and Red Hat provide a "/usr/bin/python2.4" (or similar,
    with major/minor number), even if they also provide "/usr/bin/python".
    So, yes, it should be safe.

    Note that you may need to build and install a second copy of any
    packages which you need access to with the supplemental version of
    Python. You can build packages of these files for the Python 2.4
    interpreters for packages which use Distutils, by using the command
    "python2.4 setup.py bdist_rpm".

    This is by far the preferred way to install a different version of
    Python to the default version provided with a distribution, as you don't
    then conflict with packages that require the default version.
    I do have a separate package installed for Python2.4 and it coexists
    with Python2.3. The real problem is that a great number of other
    packages, which are initially part of the system, depend on Python2.3 so
    I must leave /usr/bin/python as Python2.3. I do not know of a way to
    reinstall these other packages to use Python2.4 instead. Does the line
    above, "python2.4 setup.py bdist_rpm" mean that I am supposed to run
    this against each of these other package's rpm files and substitute for
    "bdist_rpm" the name of the rpm file ?
    Also, it is better to do it like this using real packages than to rename
    files manually. I have used the above successfully on Fedora Core 3 (and
    other similar versions on other distro versions), if it doesn't work for
    you there is a source RPM available to rebuild from
    Is "bdist_rpm" the source rpm for these packages which currently depend
    on Python2.3 ?

    Further help getting my Fedora 3 packages which depend on Python2.3 to
    use Python2.4 would be appreciated.
  • Joseph Garvin at Apr 8, 2005 at 12:52 pm
    Another solution is to just install 2.4 and then make an alias for
    yum='/usr/bin/python2.3 yum' or whatever the path is :)

    Edward Diener wrote:
    I can install Python 2.4 on the Fedora 3 Linux system, but after I do
    a number of Linux utilities and commands, like yum, stop working
    because they were dependent on the Python 2.3 installation. What
    happens is that Python 2.4 replaces the /usr/bin/python module with
    the Python 2.4 version. If I replace /usr/bin/python with the Python
    2.3 version executable, which is still on my system, that all the
    aforesaid modules depend on, they start working again, but I can no
    longer execute modules, like IDLE, which was part of my Python 2.4
    distribution.

    What is the solution to this ? The operating system was installed with
    Python 2.3 and the development libraries but no tools, doc, or
    otherwise. I have installed Python 2.4 with all the RPMs and copied
    down the Python 2.4 documentation to my machine ( since
    python24-docs.rpm gives one very little ). I would naturally like to
    use Python 2.4 without killing all the commands that depend on Python
    2.3. No doubt these commands have their modules in the site libraries
    for Python 2.3. Of course I would love to update these dependencies to
    use Python 2.4 but newer RPMs for these commands do not exist.

    I do not know whether this is a Python problem or a Fedora 3 problem
    but I thought I would ask here first and see if anybody else had the
    same problem. I imagine the problem might exist on other Linux systems.
  • Edward Diener at Apr 8, 2005 at 4:42 pm

    John Ridley wrote:
    --- Edward Diener wrote:
    [snip]
    I do not know whether this is a Python problem or a Fedora 3 problem
    but
    I thought I would ask here first and see if anybody else had the same

    problem. I imagine the problem might exist on other Linux systems.

    On my Mandrake 10.1 system I have the default python 2.3 installation
    plus a separate python 2.4 installation which I compiled from source.
    There are two executables (python2.3 and python2.4) in /usr/bin, plus a
    hard-link (from python2.4) named python. If necessary, I could switch
    back to the default setup by replacing the hard-link with one from
    python2.3 - so the system would then have its preferred python version
    and I could selectively run python2.4 whenever appropriate. So far,
    Mandrake has not complained about using python 2.4 exclusively, so I
    might try removing the old installation eventually. (Then again, it's
    always handy to keep it for compatibility testing).
    I need python to be python2.3 else many utilities no longer work. The
    problem is then using IDLE and pydoc for Python2.4 since neither are .py
    scripts and need python to be a link to python2.4 and not python2.3. I
    guess the solution is to write a script a shell script which links
    python to python2.4, run IDLE let's say, then link back to python2.3.
    However while I am doing this, other system facilities which depend on
    python to be python2.3 will be dead.
  • Edward Diener at Apr 8, 2005 at 5:30 pm

    Joseph Garvin wrote:
    Another solution is to just install 2.4 and then make an alias for
    yum='/usr/bin/python2.3 yum' or whatever the path is :)
    If it were just 'yum' under Fedora 3, I could probably do that but
    looking at the dependencies on the python2.3 package in Synaptic there
    must be about 50 other packages mentioned. Which one of these
    specifically use python2.3 to execute their .py scripts and which ones
    just use python2.3 shared libraries is another matter which will take
    much work to discover. But thanks for your suggestion nonetheless.
    Edward Diener wrote:

    I can install Python 2.4 on the Fedora 3 Linux system, but after I do
    a number of Linux utilities and commands, like yum, stop working
    because they were dependent on the Python 2.3 installation. What
    happens is that Python 2.4 replaces the /usr/bin/python module with
    the Python 2.4 version. If I replace /usr/bin/python with the Python
    2.3 version executable, which is still on my system, that all the
    aforesaid modules depend on, they start working again, but I can no
    longer execute modules, like IDLE, which was part of my Python 2.4
    distribution.

    What is the solution to this ? The operating system was installed with
    Python 2.3 and the development libraries but no tools, doc, or
    otherwise. I have installed Python 2.4 with all the RPMs and copied
    down the Python 2.4 documentation to my machine ( since
    python24-docs.rpm gives one very little ). I would naturally like to
    use Python 2.4 without killing all the commands that depend on Python
    2.3. No doubt these commands have their modules in the site libraries
    for Python 2.3. Of course I would love to update these dependencies to
    use Python 2.4 but newer RPMs for these commands do not exist.

    I do not know whether this is a Python problem or a Fedora 3 problem
    but I thought I would ask here first and see if anybody else had the
    same problem. I imagine the problem might exist on other Linux systems.
  • John Ridley at Apr 9, 2005 at 4:01 pm

    * Edward Diener wrote:
    I need python to be python2.3 else many utilities no longer work.
    Then leave your 2.3 installation exactly as it is (so that python is a
    link to python2.3) and run python2.4 where needed.

    To specifically use python 2.4 to run IDLE, simply type in a shell:

    [user]$ python2.4 /usr/bin/idle

    Alternatively, create your own (executable) idle or pydoc with a
    shebang that points permanently at python2.4. For example:

    file: $HOME/bin/idle2.4
    -----------------------------------
    #!/usr/bin/python2.4

    from idlelib.PyShell import main
    if __name__ == '__main__':
    main()
    -----------------------------------

    Then if $HOME/bin is on your PATH, you can simply run: idle2.4
    The problem is then using IDLE and pydoc for Python2.4 since neither
    are .py scripts
    Really?! What are they on Fedora, then?


    John Ridley

    Send instant messages to your online friends http://uk.messenger.yahoo.com
  • Edward Diener at Apr 9, 2005 at 9:55 pm

    John Ridley wrote:
    * Edward Diener wrote:
    I need python to be python2.3 else many utilities no longer work.

    Then leave your 2.3 installation exactly as it is (so that python is a
    link to python2.3) and run python2.4 where needed.

    To specifically use python 2.4 to run IDLE, simply type in a shell:

    [user]$ python2.4 /usr/bin/idle

    Alternatively, create your own (executable) idle or pydoc with a
    shebang that points permanently at python2.4. For example:

    file: $HOME/bin/idle2.4
    -----------------------------------
    #!/usr/bin/python2.4

    from idlelib.PyShell import main
    if __name__ == '__main__':
    main()
    -----------------------------------

    Then if $HOME/bin is on your PATH, you can simply run: idle2.4
    This change worked. Thanks !
    The problem is then using IDLE and pydoc for Python2.4 since neither
    are .py scripts

    Really?! What are they on Fedora, then?
    I realized they are links to the respective idle2.4.py and pydoc2.4.py
    scripts.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedApr 5, '05 at 9:21p
activeApr 9, '05 at 9:55p
posts12
users6
websitepython.org

People

Translate

site design / logo © 2022 Grokbase