install older Python version parallel

S

S. Dornseifer

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
 
E

edexter

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

0n windows I had multiple versions installed ex
python24
python25

i would write a batch file
C:\python24\python.exe test.py
pause

the pause is there just so that I can see an error message if there is
one.

I have no idea what would work for the mac or linux though... I
suspect something simular might work after all
why rewrite all your software because someone else wants you to have a
particular version of python not with the amount of disk space that is
available now-adays..
 
E

edexter

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
 
S

Simon

edexter said:
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, 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).

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?

Cheers,
Simon
 
T

Tim Wintle

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

It won't normally work on linux these days because most distributions of
gnu/linux need python to run the GUI.

Put another way it means if something doesn't work how you want it, it's
just some python somewhere to change :)


(Trust me, you don't want to remove the system version of python on most
linux distributions or on macs)


Tim
 
S

Simon

Simon said:
edexter said:
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, 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).

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?

Cheers,
Simon

OK, I found an 'Ansatzpunkt' where I can start from:
_tkinter.so is missing in /usr/local/lib/python2.4/lib-dynload
so I guess my python is not configured for using Tcl?

I found the following from
http://mail.python.org/pipermail/python-list/2001-December/117984.html

Install Tcl, Tk and Python as peers of each other ...
1. run configure in Python
2. make and make install Tcl (unless you're using binary dist)make and
3. make install Tk (unless you're using binary dist)
4. edit Setup
5. make and make install Python

I guess, I will try that next. Maybe somebody knows a more detailed
instruction. My problems:

a)
I don't know if I have to set special flags to make the three packages
aware of each other during 'configure', 'make', and 'make altinstall'.

b)
Also, I don't know, which setup do I have to edit during step 4.

c)
Which Tcl and Tk versions do I need, don't I need tcl-devel in addition?

Sorry for so many questions, but this stuff is new for me,
Simon
 
S

Simon

Benjamin said:
On Fri, Jun 12, 2009 at 9:31 AM, Simon <[email protected]

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
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
 
S

Simon

Christian said:
zypper should have installed all necessary dependencies, including a
whole bunch of X11 headers. Something seems to be wrong on your system
or SuSE's package dependencies.
I know why I dislike SuSE. :) Although I started my Linux career 12
years ago with SuSE I prefer Debian based systems since Woody came out
in 2002. :)


zypper search X11 | grep devel
...
zypper install xorg-x11-devel

That should (hopefully) do the trick. On a Debian based systems it's
much easier to install all Python dependencies with "apt-get build-dep
python2.5"

To quote SuSE: "Have a lot of fun ..."

Und viel Glück!

Christian

Danke :)

On Monday, I will be able to tell if it worked out, or if I have to try
a new strategy, e.g. to convince the admin about (K)ubuntu.
 
S

S. Dornseifer

Simon said:
Danke :)

On Monday, I will be able to tell if it worked out, or if I have to try
a new strategy, e.g. to convince the admin about (K)ubuntu.

Problem is solved, thanks again :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top