Skip to content
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

ZMT zurich med tech

  1. Home
  2. Sim4Life
  3. Python API
  4. S4L v6.0 python pip install tkinter

S4L v6.0 python pip install tkinter

Scheduled Pinned Locked Moved Python API
9 Posts 5 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GuOLU
    wrote on last edited by
    #1

    Hi guys,

    I have s4l v6.0 installed on my PC. I would like to develop some python scripts which needs tkinter modules.

    I tried to directly import tkinter module, but it shows that "no module named tkinter".

    Then, I tried to pip install tkinter in the command prompt window. But it comes up with "Could not find a version that satisfies the requirement tkinter"

    It seems that tkinter is already installed with python 3.x versions, but I do not know what is wrong with my installation.

    1 Reply Last reply
    0
    • SylvainS Offline
      SylvainS Offline
      Sylvain
      ZMT
      wrote on last edited by
      #2

      Hi guOLU,

      Unfortunately the Python version that is bundled with Sim4Life does not include tkinter and it is far from trivial to install it manually. We are working on a solution but it is hard to say when it will be ready to be released.

      In the meantime if you provide more detail on what you are trying to do, maybe we can find a workaround?

      G 1 Reply Last reply
      0
      • M Offline
        M Offline
        montanaro
        wrote on last edited by
        #3

        Are you maybe not capitalizing it correctly?
        This works in Sim4Life 5.2 (haven't used S4L 6)

        from Tkinter import Tk

        (I use it to copy an input file name to clipboard)

        SylvainS G 2 Replies Last reply
        0
        • M montanaro

          Are you maybe not capitalizing it correctly?
          This works in Sim4Life 5.2 (haven't used S4L 6)

          from Tkinter import Tk

          (I use it to copy an input file name to clipboard)

          SylvainS Offline
          SylvainS Offline
          Sylvain
          ZMT
          wrote on last edited by
          #4

          @montanaro are you possibly using the Python2 version? I think only Py2 has Tkinter with a capital T...

          1 Reply Last reply
          0
          • M montanaro

            Are you maybe not capitalizing it correctly?
            This works in Sim4Life 5.2 (haven't used S4L 6)

            from Tkinter import Tk

            (I use it to copy an input file name to clipboard)

            G Offline
            G Offline
            GuOLU
            wrote on last edited by
            #5

            @montanaro Yes, Sim4life 5.2 should be fine. The Python version should be v2.7, I think. However, Sim4life 6.0 is using Python 3.6.8. I think this version may have some issues with tkinter package.

            Perhaps, Sim4life 7.0 may fix this issue I guess.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              montanaro
              wrote on last edited by
              #6

              Oh, too bad ... Yeah, it was working on Python 2.7

              I remembered you (Sylvain) had a post about pip installing new packages, I found it here

              https://forum.zmt.swiss/topic/10/how-to-install-additional-python-packages

              Maybe this helps? Or maybe better to find another workaround to what you're trying to do

              1 Reply Last reply
              0
              • SylvainS Sylvain

                Hi guOLU,

                Unfortunately the Python version that is bundled with Sim4Life does not include tkinter and it is far from trivial to install it manually. We are working on a solution but it is hard to say when it will be ready to be released.

                In the meantime if you provide more detail on what you are trying to do, maybe we can find a workaround?

                G Offline
                G Offline
                GuOLU
                wrote on last edited by
                #7

                @sylvain Thanks for your help. I agree with you that this problem is caused by the Python version. Perhaps, may the Python version be upgraded in the next Sim4Life version, v7.0?

                For me, actually, I would like a window popped out to selected the desired file and folder. Then I could have the directories of these files. Based on my experience, using Tkinter is an easy way to achieve this.

                Currently, I already used the other modules to achieve the similar function. But it is just not as convenient as using Tkinter.

                J 1 Reply Last reply
                0
                • G GuOLU

                  @sylvain Thanks for your help. I agree with you that this problem is caused by the Python version. Perhaps, may the Python version be upgraded in the next Sim4Life version, v7.0?

                  For me, actually, I would like a window popped out to selected the desired file and folder. Then I could have the directories of these files. Based on my experience, using Tkinter is an easy way to achieve this.

                  Currently, I already used the other modules to achieve the similar function. But it is just not as convenient as using Tkinter.

                  J Offline
                  J Offline
                  Jasper Goethals
                  wrote on last edited by
                  #8

                  @guolu Could you share your solution? I would like to do the same. Thanks in advance.

                  B 1 Reply Last reply
                  0
                  • J Jasper Goethals

                    @guolu Could you share your solution? I would like to do the same. Thanks in advance.

                    B Offline
                    B Offline
                    beltianleader
                    wrote on last edited by
                    #9

                    @jasper-goethals hei im new here, for sim4life Light v7.. still cant use Tkinter so use another module PyQt5 its not best solution but its work for me

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Search