473,763 Members | 5,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python 2.5 Installation and Tkinter

Under Solaris 10 I installed tcl 8.5 and tk8.5 and they work just fine.
I built both with
../configure -prefix /usr/local/python/lib

I then set LD_RUN_PATH to /usr/local/python/lib and ran the ./configure
for Python 2.5 with no arguments. When I run make, it states:

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

I verified that the libraries are in /usr/local/python/lib. If I run
/usr/local/python/bin/wish8.5 it works.

My path incudes /usr/local/python/bin:/usr/local/python/lib.

How do I get Python to recognize Tcl/Tk for the build?

Sep 22 '06 #1
4 5098

milan_sanremo wrote:
Under Solaris 10 I installed tcl 8.5 and tk8.5 and they work just fine.
I built both with
./configure -prefix /usr/local/python/lib

I then set LD_RUN_PATH to /usr/local/python/lib and ran the ./configure
for Python 2.5 with no arguments. When I run make, it states:

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

I verified that the libraries are in /usr/local/python/lib. If I run
/usr/local/python/bin/wish8.5 it works.

My path incudes /usr/local/python/bin:/usr/local/python/lib.

How do I get Python to recognize Tcl/Tk for the build?
I went back and rebuilt everything with the defaults. the tcl and tk
libs were written to /usr/local/lib.

Running python with the default settings does not find it. Changing
Modules/Setup TKLIB=/usr/local/lib still produces the error:

cc -shared
build/temp.solaris-2.10-i86pc-2.5/tmp/Python-2.5/Modules/_tkinter.o
build/temp.solaris-2.10-i86pc-2.5/tmp/Python-2.5/Modules/tkappinit.o
-L/usr/openwin/lib -L/usr/local/lib -ltk8.5 -ltcl8.5 -lX11 -o
build/lib.solaris-2.10-i86pc-2.5/_tkinter.so

** WARNING: renaming "_tkinter" since importing it failed: ld.so.1:
python: fatal: libtk8.5.so: open failed: No such file or directory
running build_scripts

Yet, the file exists in /usr/local/lib. What am I missing?

Sep 22 '06 #2
milan_sanremo schrieb:
cc -shared
build/temp.solaris-2.10-i86pc-2.5/tmp/Python-2.5/Modules/_tkinter.o
build/temp.solaris-2.10-i86pc-2.5/tmp/Python-2.5/Modules/tkappinit.o
-L/usr/openwin/lib -L/usr/local/lib -ltk8.5 -ltcl8.5 -lX11 -o
build/lib.solaris-2.10-i86pc-2.5/_tkinter.so

Yet, the file exists in /usr/local/lib. What am I missing?
The system doesn't look in /usr/local/lib when searching for shared
libraries. You have the usual options:

1. Set LD_RUN_PATH at build time to include /usr/local/lib
2. Set LD_LIBRARY_PATH at run time to include /usr/local/lib
3. Use crle to add /usr/local/lib to the system wide search path

Even though it is quite intrusive, I typically prefer to do 3.
That way, I don't have to hard-code library paths into executables,
don't need my users to set environment variables, and have most
autoconf-based software work out of the box.

If you have never used crle before, understand that great care
is necessary in using it. See the EXAMPLES in crle(8). You can
either use -u -l to add a directory at the end of the search
path, or just -l to overwrite the search path; make sure the
original search path is still included.

Regards,
Martin
Sep 23 '06 #3
The system doesn't look in /usr/local/lib when searching for shared
libraries. You have the usual options:

1. Set LD_RUN_PATH at build time to include /usr/local/lib
2. Set LD_LIBRARY_PATH at run time to include /usr/local/lib
3. Use crle to add /usr/local/lib to the system wide search path

Even though it is quite intrusive, I typically prefer to do 3.
That way, I don't have to hard-code library paths into executables,
don't need my users to set environment variables, and have most
autoconf-based software work out of the box.

If you have never used crle before, understand that great care
is necessary in using it. See the EXAMPLES in crle(8). You can
either use -u -l to add a directory at the end of the search
path, or just -l to overwrite the search path; make sure the
original search path is still included.

Regards,
Martin
Thanks for the detailed reply. I tried you suggestions regarding the
linking and they produce a new error message.

gcc -shared
build/temp.solaris-2.10-i86pc-2.5/export/home/rhancock/download/install/Python-2.5/Modules/_tkinter.o
build/temp.solaris-2.10-i86pc-2.5/export/home/rhancock/download/install/Python-2.5/Modules/tkappinit.o
-L/usr/openwin/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.solaris-2.10-i86pc-2.5/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed: ld.so.1:
python: fatal: libtk8.4.so: open failed: No such file or directory
running build_scripts
creating build/scripts-2.5

Yet a ls of /usr/loca/lib shows the file exists:
drwxr-xr-x 4 root root 512 Sep 27 03:37 .
drwxr-xr-x 10 root root 512 Sep 27 03:28 ..
-rw-r--r-- 1 root root 626 Sep 27 02:31 charset.alias
-r-xr-xr-x 1 root root 786320 Sep 27 03:35 libtcl8.4.so
-rw-r--r-- 1 root root 2292 Sep 27 03:35 libtclstub8.4.a
-r-xr-xr-x 1 root root 977116 Sep 27 03:37 libtk8.4.so
-rw-r--r-- 1 root root 3548 Sep 27 03:37 libtkstub8.4.a
drwxr-xr-x 8 root root 512 Sep 27 03:35 tcl8.4
-rw-r--r-- 1 root root 7254 Sep 27 03:35 tclConfig.sh
drwxr-xr-x 5 root root 1024 Sep 27 03:37 tk8.4
-rw-r--r-- 1 root root 3566 Sep 27 03:37 tkConfig.sh

LD_RUN_PATH is set to /usr/local/lib.

I'm running this as root. I've built numerous programs ofver the last
five days, all without a problem. What am I missing on the Tkinter
inclusion?

Sep 27 '06 #4
milan_sanremo schrieb:
gcc -shared
build/temp.solaris-2.10-i86pc-2.5/export/home/rhancock/download/install/Python-2.5/Modules/_tkinter.o
build/temp.solaris-2.10-i86pc-2.5/export/home/rhancock/download/install/Python-2.5/Modules/tkappinit.o
-L/usr/openwin/lib -L/usr/local/lib -ltk8.4 -ltcl8.4 -lX11 -o
build/lib.solaris-2.10-i86pc-2.5/_tkinter.so
*** WARNING: renaming "_tkinter" since importing it failed: ld.so.1:
python: fatal: libtk8.4.so: open failed: No such file or directory
running build_scripts
creating build/scripts-2.5

Yet a ls of /usr/loca/lib shows the file exists:
drwxr-xr-x 4 root root 512 Sep 27 03:37 .
drwxr-xr-x 10 root root 512 Sep 27 03:28 ..
-rw-r--r-- 1 root root 626 Sep 27 02:31 charset.alias
-r-xr-xr-x 1 root root 786320 Sep 27 03:35 libtcl8.4.so
-rw-r--r-- 1 root root 2292 Sep 27 03:35 libtclstub8.4.a
-r-xr-xr-x 1 root root 977116 Sep 27 03:37 libtk8.4.so
-rw-r--r-- 1 root root 3548 Sep 27 03:37 libtkstub8.4.a
drwxr-xr-x 8 root root 512 Sep 27 03:35 tcl8.4
-rw-r--r-- 1 root root 7254 Sep 27 03:35 tclConfig.sh
drwxr-xr-x 5 root root 1024 Sep 27 03:37 tk8.4
-rw-r--r-- 1 root root 3566 Sep 27 03:37 tkConfig.sh

LD_RUN_PATH is set to /usr/local/lib.

I'm running this as root. I've built numerous programs ofver the last
five days, all without a problem. What am I missing on the Tkinter
inclusion?
Not sure whether it's a typo: If the file is in "/usr/loca/lib", you
should set LD_RUN_PATH to that, not "/usr/local/lib".

Are you sure LD_RUN_PATH is exported?

I would do "file /usr/local/lib/libtk8.4.so", to see whether it's
a "good" file.

Then I would invoke the linker line manually (so that _tkinter.so
doesn't get removed), and then do

ldd -s build/lib.solaris-2.10-i86pc-2.5/_tkinter.so

to see how it tries to resolve shared libraries.

HTH,
Martin
Sep 27 '06 #5

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

Similar topics

4
3848
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 less - during my own installation of Python 2.3 on Fedora Core 1 Linux for a friend of mine). Anyway, HTH, L.
0
1505
by: Adelein and Jeremy | last post by:
I have just installed Python 2.3.3, after first installing Tcl/Tk 8.4.6. After successful installation of Tcl/Tk (including passing configure the '--enable-shared' option), and testing both Tcl and Tk, I unpacked Python2.3 and began a frustrating installation. After standard configuration, make told me it was renaming module _tkinter because the module was not found (sorry I am omitting the exact warning message) - I don't understand...
14
3676
by: Jeffrey Barish | last post by:
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...
47
3480
by: Kenneth McDonald | last post by:
Is there any emerging consensus on the "best" UI for toolkit. Tk never quite made it but from what I can see, both qt and wxWin are both doing fairly well in general. I'm already aware of the licensing issues surrounding qt (fwiw, I think their license fee for commercial use is eminently reasonable), so aside from that, I was wondering if there was any feedback readers could provide on the following: 1) Which plays best with Python?...
9
2268
by: wyleu | last post by:
I'm running on Mandriva 2007 (2.6.17-5mdv) and thus have python2.4.3 installed by default, I'm running code requiring yield(), so need python2.5 and have installed this sucessfully, and linked appropriately to allow me to start python2.5 by typing python2.5. However I'd like to use idle so require to be able to import _tkinter. I gather I need to modift the setup.py script in my python directory but am wary of experimenting since I've...
13
3367
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 with: Each module to be removed needs to have a justification as to why it should no longer be distributed with Python. then goes on with,
0
820
by: Rahul | last post by:
My RHEL yum package-manager comes with Python-2.4.3. We also have a seperate Python-2.4.4 Installation on our box. When I added Tkinter using 'yum install tkinter' it seems to have added it in a manner that it is exclusively visible to Python-2.4.3. I cannot import Tkinter from Python-2.4.4. What's the best way to work around this? --
8
3288
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 my pc. But, it is not getting installed and is failing by throwing the below errors. Should i need to configure / install any specific files for resolving this issue ?
4
4991
by: njwilson23 | last post by:
I'm having trouble with tkinter on a new installation of Python (2.6), built with the framework option from source that was downloaded from python.org. I'm running OS 10.4 on a PowerPC G4. The problem first arose when I tried to run matplotlib - it couldn't find tcl/tk because it was searching for 8.5, and I had 8.4. I found and built tcl/tk 8.5, which led to a new error, reproduced below: Traceback (most recent call last): File...
0
9564
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.