Re: Python 3.11.0 installation and Tkinter does not work

2022-11-23 Thread Jason Friedman
>
> 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 "", line 1, in 
>   > 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 "", line 1, in 
>   > 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.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.11.0 installation and Tkinter does not work

2022-11-23 Thread Barry Scott


> On 23 Nov 2022, at 06:31, Stefan Ram  wrote:
> 
> darkst...@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

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


Re: Python 3.11.0 installation and Tkinter does not work

2022-11-22 Thread Barry


> On 22 Nov 2022, at 16:09, r...@zedat.fu-berlin.de wrote:
> 
> darkst...@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
> 

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


Re: Python 3.11.0 installation and Tkinter does not work

2022-11-22 Thread Mats Wichmann

On 11/21/22 14:41, Thomas Passin wrote:

On 11/21/2022 1:24 PM, Stefan Ram wrote:

darkst...@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.


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


Re: Python 3.11.0 installation and Tkinter does not work

2022-11-21 Thread DFS

On 11/21/2022 12:59 PM, darkst...@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 "", line 1, in 
   > 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 "", line 1, in 
   > 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)


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


Re: Python 3.11.0 installation and Tkinter does not work

2022-11-21 Thread Thomas Passin

On 11/21/2022 1:24 PM, Stefan Ram wrote:

darkst...@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!




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


Python 3.11.0 installation and Tkinter does not work

2022-11-21 Thread darkstone





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 "", line 1, in 
  > 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 "", line 1, in 
  > ImportError: DLL load failed while importing _tkinter: Das angegebene
  > Modul wurde nicht gefunden.

How can I fix this and make it work?






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