• Python 3.11.0 installation and Tkinter does not work

    From darkstone@o2online.de@21:1/5 to All on Mon Nov 21 17:59:03 2022




    Dear list,

    I want learn python for 4 weeks and have problems, installing Tkinter. If I installed 3.11.0 for my windows 8.1 from python.org and type

      >>> import _tkinter
    > Traceback (most recent call last):
    >    File "<stdin>", line 1, in <module>
    > ImportError: DLL load failed while importing _tkinter: Das angegebene
    > Modul wurde nicht gefunden.

    > So I it is a tkinter Problem and I tried this:

      >>> import _tkinter
    Traceback (most recent call last):
    >    File "<stdin>", line 1, in <module>
    > ImportError: DLL load failed while importing _tkinter: Das angegebene
    > Modul wurde nicht gefunden.

    How can I fix this and make it work?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to darkstone@o2online.de on Mon Nov 21 18:24:16 2022
    darkstone@o2online.de writes:
    import _tkinter

    I don't know why you get this error message. Here, I do not
    get an error message from that line. However, the normal way
    to use tkinter, as far as I know, is without the underscore!

    I think it might be best if you make sure that a recent
    Visual C++ Redistributable Runtime from Microsoft®
    is installed before you install Python.

    If you have no such Runtime, I have no idea how to proceed!
    Maybe uninstall Python, install the Runtime, and then install
    Python again?

    If you have chosen any unusual settings during the installation
    of Python, it might help to try an installation with the suggested
    settings.

    I am trying to learn tkinter myself and I am very surprised
    how well it offers exactly what I am looking for! I hope they
    never will remove tkinter from the standard distribution!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Passin@21:1/5 to Stefan Ram on Mon Nov 21 16:41:57 2022
    On 11/21/2022 1:24 PM, Stefan Ram wrote:
    darkstone@o2online.de writes:
    import _tkinter

    I don't know why you get this error message. Here, I do not
    get an error message from that line. However, the normal way
    to use tkinter, as far as I know, is without the underscore!

    You can import both tkinter and _tkinter, though I'm not sure why you
    would do the latter for any normal programming.

    I think it might be best if you make sure that a recent
    Visual C++ Redistributable Runtime from Microsoft®
    is installed before you install Python.

    That's a worthwhile thought.

    If you have no such Runtime, I have no idea how to proceed!
    Maybe uninstall Python, install the Runtime, and then install
    Python again?

    python.org says:

    "Note that Python 3.11.0 cannot be used on Windows 7 or earlier"

    But maybe there's something about their compilation settings or runtime
    support versions that doesn't work with the OP's version of Python 8.1.

    Or, since Python itself seems to be running, maybe the way the tkinter
    binary was compiled isn't compatible even though Python 3.11 itself is.
    Maybe this is a bug waiting to be filed...

    I would try installing a lower version, maybe an older version of Python
    3.10, and seeing if that works.

    If you have chosen any unusual settings during the installation
    of Python, it might help to try an installation with the suggested
    settings.

    I am trying to learn tkinter myself and I am very surprised
    how well it offers exactly what I am looking for! I hope they
    never will remove tkinter from the standard distribution!



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DFS@21:1/5 to darkstone@o2online.de on Mon Nov 21 17:32:17 2022
    On 11/21/2022 12:59 PM, darkstone@o2online.de wrote:





    Dear list,

    I want learn python for 4 weeks and have problems, installing Tkinter. If I installed 3.11.0 for my windows 8.1 from python.org and type

      >>> import _tkinter
    > Traceback (most recent call last):
    >    File "<stdin>", line 1, in <module>
    > ImportError: DLL load failed while importing _tkinter: Das angegebene
    > Modul wurde nicht gefunden.

    > So I it is a tkinter Problem and I tried this:

    >  >>> import _tkinter
    > Traceback (most recent call last):
    >    File "<stdin>", line 1, in <module>
    > ImportError: DLL load failed while importing _tkinter: Das angegebene
    > Modul wurde nicht gefunden.

    How can I fix this and make it work?


    When installing Python 3.11.0 did you check the box "tcl/tk and IDLE"?
    (it's an option on the Python Windows installer).


    I made sure to do that, and then this worked:

    import tkinter
    from tkinter import filedialog as fd
    from tkinter.filedialog import askopenfilename
    filename = fd.askopenfilename()
    print(filename)

    foldername = fd.askdirectory()
    print(foldername)
    time.sleep(3)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to darkstone@o2online.de on Tue Nov 22 15:34:15 2022
    darkstone@o2online.de writes:
    ImportError: DLL load failed while importing _tkinter: Das angegebene
    Modul wurde nicht gefunden.

    If you have not already done so, make sure that you install
    Python from python.org.

    Then, after the installation, you also should make sure that
    you actually use this installed version.

    import sys
    sys.version_info
    import tkinter

    It is possible that you have installed a different version
    of Python before and accidentally have opened that version,
    which may not include tkinter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mats Wichmann@21:1/5 to Thomas Passin on Tue Nov 22 08:22:08 2022
    On 11/21/22 14:41, Thomas Passin wrote:
    On 11/21/2022 1:24 PM, Stefan Ram wrote:
    darkstone@o2online.de writes:
    import _tkinter

       I don't know why you get this error message. Here, I do not
       get an error message from that line. However, the normal way
       to use tkinter, as far as I know, is without the underscore!

    You can import both tkinter and _tkinter, though I'm not sure why you
    would do the latter for any normal programming.

    No, but it's often the advice given when things are not working - see if
    the underlying tkinter module can be imported, to verify it's actually findable, so not surprised to see someone trying it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barry@21:1/5 to All on Tue Nov 22 22:18:50 2022
    On 22 Nov 2022, at 16:09, ram@zedat.fu-berlin.de wrote:

    darkstone@o2online.de writes:
    ImportError: DLL load failed while importing _tkinter: Das angegebene
    Modul wurde nicht gefunden.

    If you have not already done so, make sure that you install
    Python from python.org.

    Then, after the installation, you also should make sure that
    you actually use this installed version.

    import sys
    sys.version_info
    import tkinter

    It is possible that you have installed a different version
    of Python before and accidentally have opened that version,
    which may not include tkinter.

    In which case the error is module not found.
    The error reported suggests that a dll that _tkinter needs is missing.

    Barry



    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to darkstone@o2online.de on Wed Nov 23 06:31:03 2022
    darkstone@o2online.de writes:
    I want learn python for 4 weeks and have problems, installing Tkinter. If I=
    installed 3.11.0 for my windows 8.1 from python.org and type

    Ok, so you already installed from python.org. I wonder a
    little about the wording "installing Tkinter". Here,
    I installed /Python/ from python.org, and this /included/ tkinter.
    If you have really attempted a separate installation of tkinter,
    it may help to uninstall and instead install Python /including/
    tkinter.

    ImportError: DLL load failed while importing _tkinter: Das angegebene
    Modul wurde nicht gefunden.

    Another possibility of analysis is to watch the Python
    process using "Process Monitor" (formerly from Sysinternals)
    under Microsoft® Windows (not to be confused with "Process
    Explorer"). This program requires some familiarization,
    but then it can show you in which directories a process is
    searching for which DLLs. This might help you to find the
    name of the DLL missing and in which directory it should be.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Barry Scott@21:1/5 to All on Wed Nov 23 19:48:31 2022
    On 23 Nov 2022, at 06:31, Stefan Ram <ram@zedat.fu-berlin.de> wrote:

    darkstone@o2online.de writes:
    I want learn python for 4 weeks and have problems, installing Tkinter. If I= >> installed 3.11.0 for my windows 8.1 from python.org and type

    Ok, so you already installed from python.org. I wonder a
    little about the wording "installing Tkinter". Here,
    I installed /Python/ from python.org, and this /included/ tkinter.
    If you have really attempted a separate installation of tkinter,
    it may help to uninstall and instead install Python /including/
    tkinter.

    ImportError: DLL load failed while importing _tkinter: Das angegebene
    Modul wurde nicht gefunden.

    Another possibility of analysis is to watch the Python
    process using "Process Monitor" (formerly from Sysinternals)
    under Microsoft® Windows (not to be confused with "Process
    Explorer"). This program requires some familiarization,
    but then it can show you in which directories a process is
    searching for which DLLs. This might help you to find the
    name of the DLL missing and in which directory it should be.

    I think the depends.exe tool from sysintenals will do this as well.
    There is a mode where you run a program and it collects the data
    for all the DLLs that are used either statically linked or dynamicall
    loaded, that is the case for _tkinter.

    I have not used in in a very long time but I recall it shows errors
    from DLLs that failed to load.

    Barry




    --
    https://mail.python.org/mailman/listinfo/python-list

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jason Friedman@21:1/5 to All on Wed Nov 23 19:49:19 2022

    I want learn python for 4 weeks and have problems, installing Tkinter. If
    I installed 3.11.0 for my windows 8.1 from python.org and type

    >>> import _tkinter
    > Traceback (most recent call last):
    > File "<stdin>", line 1, in <module>
    > ImportError: DLL load failed while importing _tkinter: Das angegebene
    > Modul wurde nicht gefunden.

    > So I it is a tkinter Problem and I tried this:

    import _tkinter
    Traceback (most recent call last):
    > File "<stdin>", line 1, in <module>
    > ImportError: DLL load failed while importing _tkinter: Das angegebene
    > Modul wurde nicht gefunden.

    How can I fix this and make it work?


    Have a look at https://stackoverflow.com/questions/25905540/importerror-no-module-named-tkinter
    .

    Most of the answers are for Linux/Mac, but there are Windows answers there, too.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)