Python Forum
Problem with Pyinstaller. No module named '_tkinter'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Pyinstaller. No module named '_tkinter'
#1
Hello, I'm trying to obtain a single exectuable file to run on my MAC M1.

I use Pyinstaller in this way:

pyinstaller --onefile myproject.py

but when I run the file generate, that is located in dist folder it give me this error:

Last login: Mon May 15 16:41:51 on ttys011
/Users/antonio/Desktop/PYPROJECT/dist/spegnimento ; exit;
antonio@MacBook-Air-di-Antonio ~ % /Users/antonio/Desktop/PYPROJECT/dist/spegnimento ; exit;
Traceback (most recent call last):
File "spegnimento.py", line 4, in <module>
File "PyInstaller/loader/pyimod02_importers.py", line 352, in exec_module
File "tkinter/__init__.py", line 38, in <module>
ModuleNotFoundError: No module named '_tkinter'
[16333] Failed to execute script 'spegnimento' due to unhandled exception!


I used also a virtual env but the result is the same.
In the pip list the tk (that is tkinter) is present.

Could someone help me to solve this problem? Thanks in advance
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ModuleNotFoundError: No module named 'tkcalendar', Thonny, Windows 10 Edward_ 4 996 Apr-06-2025, 07:56 PM
Last Post: Edward_
  No module named 'importlib.metadata' EdVS 3 1,162 Jan-30-2025, 09:55 AM
Last Post: Larz60+
  problem with memory_graph module akbarza 5 1,814 Jan-14-2025, 04:31 PM
Last Post: Gribouillis
  ModuleNotFoundError: No module named 'athena_read' raman 2 1,350 Jul-01-2024, 07:52 AM
Last Post: Gribouillis
  problem using coloeama module akbarza 3 1,540 Jan-08-2024, 07:31 AM
Last Post: akbarza
  no module named 'docx' when importing docx MaartenRo 1 5,898 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 31,457 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 10,440 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 4,636 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  problem in using subprocess module akbarza 5 3,564 Sep-24-2023, 02:02 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020