Python 2.5 Installation and Tkinter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • milan_sanremo

    #1

    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?

  • milan_sanremo

    #2
    Re: Python 2.5 Installation and Tkinter


    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?

    Comment

    • Martin v. Löwis

      #3
      Re: Python 2.5 Installation and Tkinter

      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

      Comment

      • milan_sanremo

        #4
        Re: Python 2.5 Installation and Tkinter

        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?

        Comment

        • Martin v. Löwis

          #5
          Re: Python 2.5 Installation and Tkinter

          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

          Comment

          Working...