install Python-2.4.4 from source (parallel to existing Python-2.6)

Simon simon212 at gmx.de
Fri Jun 12 11:49:54 EDT 2009


Benjamin Kaplan wrote:
> 
> 
> On Fri, Jun 12, 2009 at 9:31 AM, Simon <simon212 at gmx.de 
> <mailto:simon212 at gmx.de>> wrote:
> 
>     edexter wrote:
> 
>         simon wrote:
> 
>             Hi everybody,
> 
>             The situation:
>             I wrote a GUI, based on Python, TkInter and Pmw.
>             It runs perfectly fine with Python 2.4 (providing, TkInter
>             and Pmw are
>             installed). But it crashes with Python 2.6. I tried this on
>             MacOSX11.4
>             and various Linux Distributions.
>             Crashes occurs when I activate a Pmw.Diaog (I guess this is
>             due to a bug
>             in the installed blt package), also when I use setitems on
>             Pmw.OptionMenu (I guess this is due to another package,
>             associated with
>             tcl/tk).
> 
>             The target:
>             I have to get my GUI work under openSUSE 11.1 (x86_64).
> 
>             My plan:
>             On my openSUSE 11.1 (x86_64), Python 2.6 is installed by
>             default.
>             I would like to know, how to install Python 2.4 along with
>             TkInter and
>             Pmw (and packages that are required by them), parallel to
>             the existing
>             Python 2.6. So that I do not break other software that
>             depends on Python
>             2.6.
> 
>             If you can think of another plan, I would be also glad to
>             discuss it.
> 
>             Cheers,
>             Simon
> 
> 
>         I suspect you want to install python 2.4 and then reinstall 2.6
>          I did
>         that in windows and I don't understand why it wouldn't work in linux
> 
> 
>     I'm afraid, installation is quit different under UNIX based systems
>     and Windows.
> 
>     I installed Python-2.4.4.tar.bz2 from python.org
>     <http://python.org>, using gcc-4.3 (within openSUSE 11.1 x86_64) via
>     'make altinstall'.
> 
>     First, I tried to configure with the following flags:
>     --prefix=/opt/python-24 --enable-framework --with-pydebug
>     This provoked an error during compilation via make (sorry, the list
>     was so long, but I will post it, if it helps).
> 
> 
> The --enable-framework option is for creating Framework builds on OS X. 
> It won't work on Linux.
>  
> 
> 
>     Second, configured again without any flags. The installation by
>     'make altinstall' to /usr/local was a success. Python2.6 seams
>     unaffected, too. So, I got my parallel installation.
> 
>     However, I cannot import modules like Tkinter or readline within
>     python2.4.
> 
>     For example, Tkinter.py is located in /usr/local/lib/python2.4/lib-tk
> 
>     sys.path says: ['', '/usr/local/lib/python24.zip',
>     '/usr/local/lib/python2.4', '/usr/local/lib/python2.4/plat-linux2',
>     '/usr/local/lib/python2.4/lib-tk',
>     '/usr/local/lib/python2.4/lib-dynload',
>     '/usr/local/lib/python2.4/site-packages']
> 
>     sys.prefix and sys.exec_prefix say: '/usr/local'
> 
>     my bash's PATH variable says:
>     /sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib64/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin
> 
>     Which configuration step did I miss after my Python2.4 installation?
>     What did I do wrong?
> 
> 
> 
> Again, give us the error message. We can't help if we don't know exactly 
> what's going on.
>  
> 
> 

Sorry, here it comes:


Python 2.4.4 (#1, Jun 12 2009, 14:11:55)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
   File "/etc/pythonstart", line 7, in ?
     import readline
ImportError: No module named readline

 >>> import Tkinter
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 38, in ?
     import _tkinter # If this fails your Python may not be configured 
for Tk
ImportError: No module named _tkinter



Right know, I'm following Christian's hint, to "install the development 
library of tk, readline, zlib and libbz2 prior to configure && make", 
because the following essential packages were not installed on my system:

autoconf automake libbz2-devel libopenssl-devel libtool ncurses-devel 
readline-devel sqlite2-devel tack tcl-devel tk-devel zlib-devel

I will let you know about the result, soon.

Cheers,
Simon



More information about the Python-list mailing list