473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Python 2.4 and Tkinter

Since upgrading to python 2.4 yesterday, I am no longer able to use
Tkinter. From http://www.python.org/moin/TkInter I learned that I need
to edit Modules/Setup to include Tkinter during the make. However, it
isn't clear to me what modifications to make. I am supposed to specify
directories in which needed files can be found. I found the Tcl/Tk
libraries in /usr/local/lib/python2.4/lib-tk, but I can't find the
Tcl/Tk headers. The default value for the headers (/usr/local/include)
doesn't work. I searched my system for tcl.h but couldn't find it.
Does anyone know how to make Tkinter work under Python 2.4?

I also don't understand why I have to go to all this trouble. Tkinter
is supposed to be included with Python, so shouldn't it be available
without any special effort?
--
Jeffrey Barish

Jul 18 '05 #1
14 3618

FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it from
scratch and everything is fine. Tkinter is there, _tkinter as well and
idle comes up as expected.

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
http://www.python.org/moin/TkInter

Jul 18 '05 #2
Jean Brouwers wrote:

FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it from
scratch and everything is fine. Tkinter is there, _tkinter as well
and idle comes up as expected.

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
http://www.python.org/moin/TkInter
Here's what I get when I import Tkinter at a python prompt:

jeffbarish@duo:~$ python
Python 2.4 (#1, Nov 30 2004, 08:58:13)
[GCC 3.2.3 20030316 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
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

I tried make clean and make. Same result. Ah, now I see that the
output from make includes:

INFO: Can't locate Tcl/Tk libs and/or headers

Aren't the libs and headers included in Python-2.4.tgz?
--
Jeffrey Barish

Jul 18 '05 #3

Here is how we understand this (which may be incomplete and/or
incorrect).

The _tkinter module is a shared library _tkinter.o and that is built
from C source file _tkinter.c. That C file and a few other tk related
C files are included in the Python distribution.

But the Tcl/Tk libraries to build the _tkinter module are coming from
/usr/local/lib in our case. And those happens to be tcl83 and tk83 in
our case.

If the Tcl/Tk libraries (and include files) are missing, you will have
to get and install those. But they are not part of the Python
distribution, as far as we know.

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
Jean Brouwers wrote:

FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it from
scratch and everything is fine. Tkinter is there, _tkinter as well
and idle comes up as expected.

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
http://www.python.org/moin/TkInter
Here's what I get when I import Tkinter at a python prompt:

jeffbarish@duo:~$ python
Python 2.4 (#1, Nov 30 2004, 08:58:13)
[GCC 3.2.3 20030316 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information. 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

I tried make clean and make. Same result. Ah, now I see that the
output from make includes:

INFO: Can't locate Tcl/Tk libs and/or headers

Aren't the libs and headers included in Python-2.4.tgz?

Jul 18 '05 #4
Jeffrey Barish wrote:
[snip]
Here's what I get when I import Tkinter at a python prompt:

jeffbarish@duo:~$ python
Python 2.4 (#1, Nov 30 2004, 08:58:13)
[GCC 3.2.3 20030316 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
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

I tried make clean and make. Same result. Ah, now I see that the
output from make includes:

INFO: Can't locate Tcl/Tk libs and/or headers

Aren't the libs and headers included in Python-2.4.tgz?


On Windows, the Python distribution does include Tkinter and tcl/tk. It's
different on Unices (including Linux): since tcl/tk is very often installed by
default, it is not included in the Python distribution.

Have you looked for libraries / header files in /usr/lib and /usr/include? This
is usually where they go when you install them with Linux. Since you mentionned
you upgraded to Python 2.4, I assume you had a working installation of a
previous Python version. So the tcl/tk libraries and header files must be there
somewhere. Did you look at your Modules/Setup for the older Python? If Tkinter
was working with this version, the setup for the _tkinter module should use the
correct paths.

HTH
--
- Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com
Jul 18 '05 #5
Jean Brouwers wrote:

Here is how we understand this (which may be incomplete and/or
incorrect).

The _tkinter module is a shared library _tkinter.o and that is built
from C source file _tkinter.c. That C file and a few other tk related
C files are included in the Python distribution.

But the Tcl/Tk libraries to build the _tkinter module are coming from
/usr/local/lib in our case. And those happens to be tcl83 and tk83 in
our case.

If the Tcl/Tk libraries (and include files) are missing, you will have
to get and install those. But they are not part of the Python
distribution, as far as we know.

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
Jean Brouwers wrote:
>
> FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it from
> scratch and everything is fine. Tkinter is there, _tkinter as well
> and idle comes up as expected.
>
> /Jean Brouwers
>
>
>
> In article <ma**************************************@python.o rg>,
> Jeffrey Barish <je********@starband.net> wrote:
>
>> http://www.python.org/moin/TkInter


Here's what I get when I import Tkinter at a python prompt:

jeffbarish@duo:~$ python
Python 2.4 (#1, Nov 30 2004, 08:58:13)
[GCC 3.2.3 20030316 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> 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

I tried make clean and make. Same result. Ah, now I see that the
output from make includes:

INFO: Can't locate Tcl/Tk libs and/or headers

Aren't the libs and headers included in Python-2.4.tgz?


OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back to
python2.4 make. It now bombs at:

gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o
build/temp.linux-i686-2.4/tkappinit.o -L/usr/X11R6/lib64
-L/usr/X11R6/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.linux-i686-2.4/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed: libtk8.4.so:
cannot open shared object file: No such file or directory
running build_scripts

Here's what I don't get:

root@duo:/tmp/Python-2.4# ls -l /usr/local/lib/libtk8.4.so
-rwxr-xr-x 1 root staff 893866 2004-12-02
15:28 /usr/local/lib/libtk8.4.so

The library is there but gcc claims that it isn't. Any suggestions?
--
Jeffrey Barish

Jul 18 '05 #6
Jean Brouwers wrote:

Here is how we understand this (which may be incomplete and/or
incorrect).

The _tkinter module is a shared library _tkinter.o and that is built
from C source file _tkinter.c. That C file and a few other tk related
C files are included in the Python distribution.

But the Tcl/Tk libraries to build the _tkinter module are coming from
/usr/local/lib in our case. And those happens to be tcl83 and tk83 in
our case.

If the Tcl/Tk libraries (and include files) are missing, you will have
to get and install those. But they are not part of the Python
distribution, as far as we know.

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
Jean Brouwers wrote:
>
> FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it from
> scratch and everything is fine. Tkinter is there, _tkinter as well
> and idle comes up as expected.
>
> /Jean Brouwers
>
>
>
> In article <ma**************************************@python.o rg>,
> Jeffrey Barish <je********@starband.net> wrote:
>
>> http://www.python.org/moin/TkInter


Here's what I get when I import Tkinter at a python prompt:

jeffbarish@duo:~$ python
Python 2.4 (#1, Nov 30 2004, 08:58:13)
[GCC 3.2.3 20030316 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> 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

I tried make clean and make. Same result. Ah, now I see that the
output from make includes:

INFO: Can't locate Tcl/Tk libs and/or headers

Aren't the libs and headers included in Python-2.4.tgz?


OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back to
python2.4 make. It now bombs at:

gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o
build/temp.linux-i686-2.4/tkappinit.o -L/usr/X11R6/lib64
-L/usr/X11R6/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.linux-i686-2.4/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed: libtk8.4.so:
cannot open shared object file: No such file or directory
running build_scripts

Here's what I don't get:

root@duo:/tmp/Python-2.4# ls -l /usr/local/lib/libtk8.4.so
-rwxr-xr-x 1 root staff 893866 2004-12-02
15:28 /usr/local/lib/libtk8.4.so

The library is there but gcc claims that it isn't. Any suggestions?
--
Jeffrey Barish

Jul 18 '05 #7

It is hard to tell what is wrong, exactly. Two suggestions:

If this is a 32-bit build, why is there a "-L/usr/X11R6/lib64" and
*before* the regular "-L/usr/X11R6/lib"? Try to rerun just that line
"gcc -pthread .... _tkinter.so" but without the "-L/usr/X11R6/lib64"
option.

If that still fails, try a fresh reconfigure and rebuild from scratch,
now that the Tcl/Tk libs are there. Start with "./configure ...." per
the instructions in the README file, run "make clean" etc..

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
Jean Brouwers wrote:

Here is how we understand this (which may be incomplete and/or
incorrect).

The _tkinter module is a shared library _tkinter.o and that is built
from C source file _tkinter.c. That C file and a few other tk related
C files are included in the Python distribution.

But the Tcl/Tk libraries to build the _tkinter module are coming from
/usr/local/lib in our case. And those happens to be tcl83 and tk83 in
our case.

If the Tcl/Tk libraries (and include files) are missing, you will have
to get and install those. But they are not part of the Python
distribution, as far as we know.

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
Jean Brouwers wrote:

>
> FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it from
> scratch and everything is fine. Tkinter is there, _tkinter as well
> and idle comes up as expected.
>
> /Jean Brouwers
>
>
>
> In article <ma**************************************@python.o rg>,
> Jeffrey Barish <je********@starband.net> wrote:
>
>> http://www.python.org/moin/TkInter

Here's what I get when I import Tkinter at a python prompt:

jeffbarish@duo:~$ python
Python 2.4 (#1, Nov 30 2004, 08:58:13)
[GCC 3.2.3 20030316 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> 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

I tried make clean and make. Same result. Ah, now I see that the
output from make includes:

INFO: Can't locate Tcl/Tk libs and/or headers

Aren't the libs and headers included in Python-2.4.tgz?


OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back to
python2.4 make. It now bombs at:

gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o
build/temp.linux-i686-2.4/tkappinit.o -L/usr/X11R6/lib64
-L/usr/X11R6/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.linux-i686-2.4/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed: libtk8.4.so:
cannot open shared object file: No such file or directory
running build_scripts

Here's what I don't get:

root@duo:/tmp/Python-2.4# ls -l /usr/local/lib/libtk8.4.so
-rwxr-xr-x 1 root staff 893866 2004-12-02
15:28 /usr/local/lib/libtk8.4.so

The library is there but gcc claims that it isn't. Any suggestions?

Jul 18 '05 #8

It is hard to tell what is wrong, exactly. Two suggestions:

If this is a 32-bit build, why is there a "-L/usr/X11R6/lib64" and
*before* the regular "-L/usr/X11R6/lib"? Try to rerun just that line
"gcc -pthread .... _tkinter.so" but without the "-L/usr/X11R6/lib64"
option.

If that still fails, try a fresh reconfigure and rebuild from scratch,
now that the Tcl/Tk libs are there. Start with "./configure ...." per
the instructions in the README file, run "make clean" etc..

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
Jean Brouwers wrote:

Here is how we understand this (which may be incomplete and/or
incorrect).

The _tkinter module is a shared library _tkinter.o and that is built
from C source file _tkinter.c. That C file and a few other tk related
C files are included in the Python distribution.

But the Tcl/Tk libraries to build the _tkinter module are coming from
/usr/local/lib in our case. And those happens to be tcl83 and tk83 in
our case.

If the Tcl/Tk libraries (and include files) are missing, you will have
to get and install those. But they are not part of the Python
distribution, as far as we know.

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
Jean Brouwers wrote:

>
> FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it from
> scratch and everything is fine. Tkinter is there, _tkinter as well
> and idle comes up as expected.
>
> /Jean Brouwers
>
>
>
> In article <ma**************************************@python.o rg>,
> Jeffrey Barish <je********@starband.net> wrote:
>
>> http://www.python.org/moin/TkInter

Here's what I get when I import Tkinter at a python prompt:

jeffbarish@duo:~$ python
Python 2.4 (#1, Nov 30 2004, 08:58:13)
[GCC 3.2.3 20030316 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> 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

I tried make clean and make. Same result. Ah, now I see that the
output from make includes:

INFO: Can't locate Tcl/Tk libs and/or headers

Aren't the libs and headers included in Python-2.4.tgz?


OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back to
python2.4 make. It now bombs at:

gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o
build/temp.linux-i686-2.4/tkappinit.o -L/usr/X11R6/lib64
-L/usr/X11R6/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.linux-i686-2.4/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed: libtk8.4.so:
cannot open shared object file: No such file or directory
running build_scripts

Here's what I don't get:

root@duo:/tmp/Python-2.4# ls -l /usr/local/lib/libtk8.4.so
-rwxr-xr-x 1 root staff 893866 2004-12-02
15:28 /usr/local/lib/libtk8.4.so

The library is there but gcc claims that it isn't. Any suggestions?

Jul 18 '05 #9
Jean Brouwers wrote:

It is hard to tell what is wrong, exactly. Two suggestions:

If this is a 32-bit build, why is there a "-L/usr/X11R6/lib64" and
*before* the regular "-L/usr/X11R6/lib"? Try to rerun just that line
"gcc -pthread .... _tkinter.so" but without the "-L/usr/X11R6/lib64"
option.

If that still fails, try a fresh reconfigure and rebuild from scratch,
now that the Tcl/Tk libs are there. Start with "./configure ...." per
the instructions in the README file, run "make clean" etc..

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
Jean Brouwers wrote:
>
> Here is how we understand this (which may be incomplete and/or
> incorrect).
>
> The _tkinter module is a shared library _tkinter.o and that is
> built
> from C source file _tkinter.c. That C file and a few other tk
> related C files are included in the Python distribution.
>
> But the Tcl/Tk libraries to build the _tkinter module are coming
> from
> /usr/local/lib in our case. And those happens to be tcl83 and tk83
> in our case.
>
> If the Tcl/Tk libraries (and include files) are missing, you will
> have
> to get and install those. But they are not part of the Python
> distribution, as far as we know.
>
> /Jean Brouwers
>
>
>
> In article <ma**************************************@python.o rg>,
> Jeffrey Barish <je********@starband.net> wrote:
>
>> Jean Brouwers wrote:
>>
>> >
>> > FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it
>> > from
>> > scratch and everything is fine. Tkinter is there, _tkinter as
>> > well and idle comes up as expected.
>> >
>> > /Jean Brouwers
>> >
>> >
>> >
>> > In article
>> > <ma**************************************@python.o rg>, Jeffrey
>> > Barish <je********@starband.net> wrote:
>> >
>> >> http://www.python.org/moin/TkInter
>>
>> Here's what I get when I import Tkinter at a python prompt:
>>
>> jeffbarish@duo:~$ python
>> Python 2.4 (#1, Nov 30 2004, 08:58:13)
>> [GCC 3.2.3 20030316 (Debian prerelease)] on linux2
>> Type "help", "copyright", "credits" or "license" for more
>> information.
>> >>> 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
>>
>> I tried make clean and make. Same result. Ah, now I see that the
>> output from make includes:
>>
>> INFO: Can't locate Tcl/Tk libs and/or headers
>>
>> Aren't the libs and headers included in Python-2.4.tgz?


OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back
to
python2.4 make. It now bombs at:

gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o
build/temp.linux-i686-2.4/tkappinit.o -L/usr/X11R6/lib64
-L/usr/X11R6/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.linux-i686-2.4/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed:
libtk8.4.so: cannot open shared object file: No such file or
directory running build_scripts

Here's what I don't get:

root@duo:/tmp/Python-2.4# ls -l /usr/local/lib/libtk8.4.so
-rwxr-xr-x 1 root staff 893866 2004-12-02
15:28 /usr/local/lib/libtk8.4.so

The library is there but gcc claims that it isn't. Any suggestions?


It turns out that the problem is in the step after the gcc. I have now
tracked it into setup.py. There is a call to imp.load_dynamic() that
fails. I haven't been able to figure out why yet, in large part
because I am not familiar with module imp (and imp.load_dynamic isn't
even documented).
--
Jeffrey Barish

Jul 18 '05 #10
Jean Brouwers wrote:

It is hard to tell what is wrong, exactly. Two suggestions:

If this is a 32-bit build, why is there a "-L/usr/X11R6/lib64" and
*before* the regular "-L/usr/X11R6/lib"? Try to rerun just that line
"gcc -pthread .... _tkinter.so" but without the "-L/usr/X11R6/lib64"
option.

If that still fails, try a fresh reconfigure and rebuild from scratch,
now that the Tcl/Tk libs are there. Start with "./configure ...." per
the instructions in the README file, run "make clean" etc..

/Jean Brouwers

In article <ma**************************************@python.o rg>,
Jeffrey Barish <je********@starband.net> wrote:
Jean Brouwers wrote:
>
> Here is how we understand this (which may be incomplete and/or
> incorrect).
>
> The _tkinter module is a shared library _tkinter.o and that is
> built
> from C source file _tkinter.c. That C file and a few other tk
> related C files are included in the Python distribution.
>
> But the Tcl/Tk libraries to build the _tkinter module are coming
> from
> /usr/local/lib in our case. And those happens to be tcl83 and tk83
> in our case.
>
> If the Tcl/Tk libraries (and include files) are missing, you will
> have
> to get and install those. But they are not part of the Python
> distribution, as far as we know.
>
> /Jean Brouwers
>
>
>
> In article <ma**************************************@python.o rg>,
> Jeffrey Barish <je********@starband.net> wrote:
>
>> Jean Brouwers wrote:
>>
>> >
>> > FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it
>> > from
>> > scratch and everything is fine. Tkinter is there, _tkinter as
>> > well and idle comes up as expected.
>> >
>> > /Jean Brouwers
>> >
>> >
>> >
>> > In article
>> > <ma**************************************@python.o rg>, Jeffrey
>> > Barish <je********@starband.net> wrote:
>> >
>> >> http://www.python.org/moin/TkInter
>>
>> Here's what I get when I import Tkinter at a python prompt:
>>
>> jeffbarish@duo:~$ python
>> Python 2.4 (#1, Nov 30 2004, 08:58:13)
>> [GCC 3.2.3 20030316 (Debian prerelease)] on linux2
>> Type "help", "copyright", "credits" or "license" for more
>> information.
>> >>> 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
>>
>> I tried make clean and make. Same result. Ah, now I see that the
>> output from make includes:
>>
>> INFO: Can't locate Tcl/Tk libs and/or headers
>>
>> Aren't the libs and headers included in Python-2.4.tgz?


OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back
to
python2.4 make. It now bombs at:

gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o
build/temp.linux-i686-2.4/tkappinit.o -L/usr/X11R6/lib64
-L/usr/X11R6/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.linux-i686-2.4/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed:
libtk8.4.so: cannot open shared object file: No such file or
directory running build_scripts

Here's what I don't get:

root@duo:/tmp/Python-2.4# ls -l /usr/local/lib/libtk8.4.so
-rwxr-xr-x 1 root staff 893866 2004-12-02
15:28 /usr/local/lib/libtk8.4.so

The library is there but gcc claims that it isn't. Any suggestions?


It turns out that the problem is in the step after the gcc. I have now
tracked it into setup.py. There is a call to imp.load_dynamic() that
fails. I haven't been able to figure out why yet, in large part
because I am not familiar with module imp (and imp.load_dynamic isn't
even documented).
--
Jeffrey Barish

Jul 18 '05 #11
Jeffrey Barish wrote:
[snip]
OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back to
python2.4 make. It now bombs at:

gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o
build/temp.linux-i686-2.4/tkappinit.o -L/usr/X11R6/lib64
-L/usr/X11R6/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.linux-i686-2.4/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed: libtk8.4.so:
cannot open shared object file: No such file or directory
running build_scripts

Here's what I don't get:

root@duo:/tmp/Python-2.4# ls -l /usr/local/lib/libtk8.4.so
-rwxr-xr-x 1 root staff 893866 2004-12-02
15:28 /usr/local/lib/libtk8.4.so

The library is there but gcc claims that it isn't. Any suggestions?


Is /usr/local/lib in your LD_LIBRARY_PATH environment variable? It needs to be
in the compiler options for the compilation phase, but then you have to put it
in $LD_LIBRARY_PATH to be able to import the module.

HTH
--
- Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com
Jul 18 '05 #12
Jeffrey Barish wrote:
[snip]
OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back to
python2.4 make. It now bombs at:

gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o
build/temp.linux-i686-2.4/tkappinit.o -L/usr/X11R6/lib64
-L/usr/X11R6/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.linux-i686-2.4/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed: libtk8.4.so:
cannot open shared object file: No such file or directory
running build_scripts

Here's what I don't get:

root@duo:/tmp/Python-2.4# ls -l /usr/local/lib/libtk8.4.so
-rwxr-xr-x 1 root staff 893866 2004-12-02
15:28 /usr/local/lib/libtk8.4.so

The library is there but gcc claims that it isn't. Any suggestions?


Is /usr/local/lib in your LD_LIBRARY_PATH environment variable? It needs to be
in the compiler options for the compilation phase, but then you have to put it
in $LD_LIBRARY_PATH to be able to import the module.

HTH
--
- Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com
Jul 18 '05 #13
Eric Brunel wrote:
Jeffrey Barish wrote:
[snip]
OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back
to
python2.4 make. It now bombs at:

gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o
build/temp.linux-i686-2.4/tkappinit.o -L/usr/X11R6/lib64
-L/usr/X11R6/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.linux-i686-2.4/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed:
libtk8.4.so: cannot open shared object file: No such file or
directory running build_scripts

Here's what I don't get:

root@duo:/tmp/Python-2.4# ls -l /usr/local/lib/libtk8.4.so
-rwxr-xr-x 1 root staff 893866 2004-12-02
15:28 /usr/local/lib/libtk8.4.so

The library is there but gcc claims that it isn't. Any suggestions?


Is /usr/local/lib in your LD_LIBRARY_PATH environment variable? It
needs to be in the compiler options for the compilation phase, but
then you have to put it in $LD_LIBRARY_PATH to be able to import the
module.

HTH


That was the problem. Thanks for the help.
--
Jeffrey Barish

Jul 18 '05 #14
I found this thread like 3 hrs ago..., I followed your advises and thank you all, but there was still one step left for me...

I had installed aMSN, and as a dependency it installed Tcl/Tk 8.5, but only the binaries, not the dev packages...

The python installer was confused, thinking that I had installed the 8.5 dev packages (given that I had the 8.5 binaries), and was looking in the right directories for the wrong files (tcl8.5/tk8.5).

The thing is that I had the 8.4 dev packages, and those were the ones I wanted it to install...

I made a little change to Python-2.4.2/setup.py:

Line 981: Removed '8.5' and '85' from the For statement so it now looks like this:
for version in ['8.4', '84', '8.3', '83', '8.2',
'82', '8.1', '81', '8.0', '80']:

It instantly worked, and compiled flawlessly...

Of course you could get the dev files for the latest binaries you have for tcl/tk (8.5 in my case).

I CAN BE WRONG, and maybe this is not the way to fix it, but I'm currently installing python to learn the language, please correct me if I'm wrong.

Any way it's really interesting, and speaks for the language, that I was able to follow and deduct the way it worked, at first sight, in a new language, although I've been a programmer for years, the Python code seems to be very intuitive... I think I'll have fun learning it.

Hope this helps any one that might encounter the same problem...

Grreetings! :D

Gabriel Medina
Rha7.Com Diseño y Desarrollo Web, Soporte XOOPS y ZenCart - Rha7.Com Web Site Design and Development, XOOPS & ZenCart Support
Feb 27 '06 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
10
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
6
by: Peter Milliken | last post by:
Hi, I (think I have :-)) installed Python on my Pocket PC (obtained from http://fore.validus.com/~kashtan/). There were Tkinter binaries with it so I installed those as well. When I attempt...
1
by: John Chambers | last post by:
Sp my latest adventure is attempting to use python's Tkinter module on a few machines. On my PB (OSX 10.3.9), I got the following confusing results: /Users/jc: python Python 2.3 (#1, Sep 13...
44
by: jiang.haiyun | last post by:
Now i began to learn GUI programming. There are so many choices of GUI in the python world, wxPython, pyGTK, PyQT, Tkinter, .etc, it's difficult for a novice to decide, however. Can you draw a...
40
by: =?iso-8859-1?B?QW5kcuk=?= | last post by:
I'm really annoyed at Python - and not for the reasons already mentioned on this list. Everyone know that programming is supposed to be a dark art, nearly impossible to learn. Computer code is...
13
by: Daniel Fetchinson | last post by:
Was looking at PEP 3108, http://www.python.org/dev/peps/pep-3108/ , Is it just me or others also think that it would be a major loss to remove tkinter from the python core? PEP 3108 starts off...
8
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to...
2
by: Dudeja, Rajat | last post by:
Hi, So, now I've finally started using Eclipse and PyDev as an IDE for my GUI Application. I just wrote some sample programs as an hands on. Now I would like to take up Tkinter. I'm using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.