Help on Tkinter installation

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

    Help on Tkinter installation

    I want to do a little Tkinter in my 1 credit
    python practicum, but I am having problems
    getting everything installed correctly.
    A sample of the problem is below:


    ------------------- The python source, test.py ------------------
    from graphics import *

    def main():
    win = GraphWin("My Circle", 100, 100)
    c = Circle(Point(50 ,50), 10)
    c.draw(win)

    main()

    ----------- result of $python test.py --------------------------

    Traceback (most recent call last):
    File "test.py", line 1, in ?
    from graphics import *
    File "/home/slimick/cs198/graphics.py", line 85, in ?
    import Tkinter
    File "/usr/local/lib/python2.3/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

    ------------result of $locate _tkinter ------------------------------

    /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp
    /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp.exp
    /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Modules/_dummy_tkinter. c
    /usr/src/redhat/SOURCES/Python-2.3.2/Modules/_tkinter.c
    /usr/src/redhat/SOURCES/Python-2.3.2/PC/os2vacpp/_tkinter.def
    /usr/src/redhat/SOURCES/Python-2.3.2/PCbuild/_tkinter.dsp

    --------------------------------------------------------------------

    I would appreciate any help on this.

    And, thanks in advance

    john slimick
    slimick@pitt,ed u
    university of pittsburgh at bradford
  • Cameron Laird

    #2
    Re: Help on Tkinter installation

    In article <slrnc5hli1.lpk .slimick@venang o.upb.pitt.edu> ,
    John Slimick <slimick@pitt.e du> wrote:[color=blue]
    >I want to do a little Tkinter in my 1 credit
    >python practicum, but I am having problems
    >getting everything installed correctly.
    >A sample of the problem is below:
    >
    >
    >------------------- The python source, test.py ------------------
    >from graphics import *
    >
    >def main():
    > win = GraphWin("My Circle", 100, 100)
    > c = Circle(Point(50 ,50), 10)
    > c.draw(win)
    >
    >main()
    >
    >----------- result of $python test.py --------------------------
    >
    >Traceback (most recent call last):
    > File "test.py", line 1, in ?
    > from graphics import *
    > File "/home/slimick/cs198/graphics.py", line 85, in ?
    > import Tkinter
    > File "/usr/local/lib/python2.3/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
    >
    >------------result of $locate _tkinter ------------------------------
    >
    >/usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp
    >/usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp.exp
    >/usr/src/redhat/SOURCES/Python-2.3.2/Mac/Modules/_dummy_tkinter. c
    >/usr/src/redhat/SOURCES/Python-2.3.2/Modules/_tkinter.c
    >/usr/src/redhat/SOURCES/Python-2.3.2/PC/os2vacpp/_tkinter.def
    >/usr/src/redhat/SOURCES/Python-2.3.2/PCbuild/_tkinter.dsp[/color]

    Comment

    • Jeff Epler

      #3
      Re: Help on Tkinter installation

      On Thu, Mar 18, 2004 at 12:04:53AM -0000, Cameron Laird wrote:[color=blue]
      > I'm curious about how you decided to start with the program you've
      > exhibited above.[/color]

      I think he's using this module:

      it looks like a canvas-based thing, and the example would probably have
      worked if Tkinter was installed properly on the system.

      Jeff

      Comment

      • wes weston

        #4
        Re: Help on Tkinter installation

        John Slimick wrote:[color=blue]
        > I want to do a little Tkinter in my 1 credit
        > python practicum, but I am having problems
        > getting everything installed correctly.
        > A sample of the problem is below:
        >
        >
        > ------------------- The python source, test.py ------------------
        > from graphics import *
        >
        > def main():
        > win = GraphWin("My Circle", 100, 100)
        > c = Circle(Point(50 ,50), 10)
        > c.draw(win)
        >
        > main()
        >
        > ----------- result of $python test.py --------------------------
        >
        > Traceback (most recent call last):
        > File "test.py", line 1, in ?
        > from graphics import *
        > File "/home/slimick/cs198/graphics.py", line 85, in ?
        > import Tkinter
        > File "/usr/local/lib/python2.3/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
        >
        > ------------result of $locate _tkinter ------------------------------
        >
        > /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp
        > /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp.exp
        > /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Modules/_dummy_tkinter. c
        > /usr/src/redhat/SOURCES/Python-2.3.2/Modules/_tkinter.c
        > /usr/src/redhat/SOURCES/Python-2.3.2/PC/os2vacpp/_tkinter.def
        > /usr/src/redhat/SOURCES/Python-2.3.2/PCbuild/_tkinter.dsp
        >
        > --------------------------------------------------------------------
        >
        > I would appreciate any help on this.
        >
        > And, thanks in advance
        >
        > john slimick
        > slimick@pitt,ed u
        > university of pittsburgh at bradford[/color]

        john,
        Go here:

        wes

        Comment

        • John Slimick

          #5
          Re: Help on Tkinter installation

          Well, thanks to some email and a fair amount of
          time with Mr Google, I found that I needed to
          update the Setup file.

          (Platform: RH 8.0)

          Prior to this I installed ActiveTCL8.4 .

          So I made what I thought were the appropriate
          changes to the "tkinter" section of Setup, I went up
          a level (to /usr/src/redhat/SOURCES/Python-2.3.2),
          did a "make" and this is what I got:

          file libtk8.4.so does not exist

          Well, when I do a locate, I find libtk8.4.so
          in

          /usr/local/ActionTcl/lib/libtk8.4.so

          So I am caught with some kind of path problem.

          Any ideas or suggestions?

          (And thanks to all the respondents so far)

          john slimick
          slimick@pitt.ed u

          =============== =============== =============== ===============[color=blue]
          > John Slimick wrote:[color=green]
          >> I want to do a little Tkinter in my 1 credit
          >> python practicum, but I am having problems
          >> getting everything installed correctly.
          >> A sample of the problem is below:
          >>
          >>
          >> ------------------- The python source, test.py ------------------
          >> from graphics import *
          >>
          >> def main():
          >> win = GraphWin("My Circle", 100, 100)
          >> c = Circle(Point(50 ,50), 10)
          >> c.draw(win)
          >>
          >> main()
          >>
          >> ----------- result of $python test.py --------------------------
          >>
          >> Traceback (most recent call last):
          >> File "test.py", line 1, in ?
          >> from graphics import *
          >> File "/home/slimick/cs198/graphics.py", line 85, in ?
          >> import Tkinter
          >> File "/usr/local/lib/python2.3/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
          >>
          >> ------------result of $locate _tkinter ------------------------------
          >>
          >> /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp
          >> /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp.exp
          >> /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Modules/_dummy_tkinter. c
          >> /usr/src/redhat/SOURCES/Python-2.3.2/Modules/_tkinter.c
          >> /usr/src/redhat/SOURCES/Python-2.3.2/PC/os2vacpp/_tkinter.def
          >> /usr/src/redhat/SOURCES/Python-2.3.2/PCbuild/_tkinter.dsp
          >>
          >> --------------------------------------------------------------------
          >>
          >> I would appreciate any help on this.
          >>
          >> And, thanks in advance
          >>
          >> john slimick
          >> slimick@pitt,ed u
          >> university of pittsburgh at bradford[/color]
          >
          > john,
          > Go here:
          > http://mail.python.org/pipermail/pyt...er/181603.html
          > wes
          >[/color]

          Comment

          • wes weston

            #6
            Re: Help on Tkinter installation

            John Slimick wrote:[color=blue]
            > Well, thanks to some email and a fair amount of
            > time with Mr Google, I found that I needed to
            > update the Setup file.
            >
            > (Platform: RH 8.0)
            >
            > Prior to this I installed ActiveTCL8.4 .
            >
            > So I made what I thought were the appropriate
            > changes to the "tkinter" section of Setup, I went up
            > a level (to /usr/src/redhat/SOURCES/Python-2.3.2),
            > did a "make" and this is what I got:
            >
            > file libtk8.4.so does not exist
            >
            > Well, when I do a locate, I find libtk8.4.so
            > in
            >
            > /usr/local/ActionTcl/lib/libtk8.4.so
            >
            > So I am caught with some kind of path problem.
            >
            > Any ideas or suggestions?
            >
            > (And thanks to all the respondents so far)
            >
            > john slimick
            > slimick@pitt.ed u
            >
            > =============== =============== =============== ===============
            >[color=green]
            >>John Slimick wrote:
            >>[color=darkred]
            >>>I want to do a little Tkinter in my 1 credit
            >>>python practicum, but I am having problems
            >>>getting everything installed correctly.
            >>>A sample of the problem is below:
            >>>
            >>>
            >>>------------------- The python source, test.py ------------------
            >>>from graphics import *
            >>>
            >>>def main():
            >>> win = GraphWin("My Circle", 100, 100)
            >>> c = Circle(Point(50 ,50), 10)
            >>> c.draw(win)
            >>>
            >>>main()
            >>>
            >>>----------- result of $python test.py --------------------------
            >>>
            >>>Traceback (most recent call last):
            >>> File "test.py", line 1, in ?
            >>> from graphics import *
            >>> File "/home/slimick/cs198/graphics.py", line 85, in ?
            >>> import Tkinter
            >>> File "/usr/local/lib/python2.3/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
            >>>
            >>>------------result of $locate _tkinter ------------------------------
            >>>
            >>>/usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp
            >>>/usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp.exp
            >>>/usr/src/redhat/SOURCES/Python-2.3.2/Mac/Modules/_dummy_tkinter. c
            >>>/usr/src/redhat/SOURCES/Python-2.3.2/Modules/_tkinter.c
            >>>/usr/src/redhat/SOURCES/Python-2.3.2/PC/os2vacpp/_tkinter.def
            >>>/usr/src/redhat/SOURCES/Python-2.3.2/PCbuild/_tkinter.dsp
            >>>
            >>>--------------------------------------------------------------------
            >>>
            >>>I would appreciate any help on this.
            >>>
            >>>And, thanks in advance
            >>>
            >>>john slimick
            >>>slimick@pitt ,edu
            >>>university of pittsburgh at bradford[/color]
            >>
            >>john,
            >> Go here:
            >>http://mail.python.org/pipermail/pyt...er/181603.html
            >>wes
            >>[/color][/color]

            Did you follow the link in my last? I just went through
            this problem and it worked for me.
            wes

            Comment

            • Kurt B. Kaiser

              #7
              Re: Help on Tkinter installation

              John Slimick <slimick@venang o.upb.pitt.edu> writes:
              [color=blue]
              > Prior to this I installed ActiveTCL8.4 .
              >
              > So I made what I thought were the appropriate
              > changes to the "tkinter" section of Setup, I went up
              > a level (to /usr/src/redhat/SOURCES/Python-2.3.2),
              > did a "make" and this is what I got:
              >
              > file libtk8.4.so does not exist
              >
              > Well, when I do a locate, I find libtk8.4.so
              > in
              >
              > /usr/local/ActionTcl/lib/libtk8.4.so
              >
              > So I am caught with some kind of path problem.
              >
              > Any ideas or suggestions?[/color]

              Your tk library is installed in a very non-standard location. Python
              can't find it.

              I suggest you install tcl and tk from the RH rpms, here's tk, you can
              search for tcl:



              Then put setup back the way it was and try again.

              If you are going to use ActiveState products, then install the whole
              package including their version of Python. If you do that, then
              direct further questions to them.

              --
              KBK

              Comment

              • wes weston

                #8
                Re: Help on Tkinter installation

                John Slimick wrote:[color=blue]
                > I want to do a little Tkinter in my 1 credit
                > python practicum, but I am having problems
                > getting everything installed correctly.
                > A sample of the problem is below:
                >
                >
                > ------------------- The python source, test.py ------------------
                > from graphics import *
                >
                > def main():
                > win = GraphWin("My Circle", 100, 100)
                > c = Circle(Point(50 ,50), 10)
                > c.draw(win)
                >
                > main()
                >
                > ----------- result of $python test.py --------------------------
                >
                > Traceback (most recent call last):
                > File "test.py", line 1, in ?
                > from graphics import *
                > File "/home/slimick/cs198/graphics.py", line 85, in ?
                > import Tkinter
                > File "/usr/local/lib/python2.3/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
                >
                > ------------result of $locate _tkinter ------------------------------
                >
                > /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp
                > /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Build/_dummy_tkinter. mcp.exp
                > /usr/src/redhat/SOURCES/Python-2.3.2/Mac/Modules/_dummy_tkinter. c
                > /usr/src/redhat/SOURCES/Python-2.3.2/Modules/_tkinter.c
                > /usr/src/redhat/SOURCES/Python-2.3.2/PC/os2vacpp/_tkinter.def
                > /usr/src/redhat/SOURCES/Python-2.3.2/PCbuild/_tkinter.dsp
                >
                > --------------------------------------------------------------------
                >
                > I would appreciate any help on this.
                >
                > And, thanks in advance
                >
                > john slimick
                > slimick@pitt,ed u
                > university of pittsburgh at bradford[/color]

                john,
                try this(the correct) link:


                wes

                Comment

                Working...