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
  problem with memory_graph module akbarza 3 378 Mar-04-2024, 10:15 AM
Last Post: snippsat
  problem using coloeama module akbarza 3 584 Jan-08-2024, 07:31 AM
Last Post: akbarza
  no module named 'docx' when importing docx MaartenRo 1 894 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 23,818 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,605 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,465 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  problem in using subprocess module akbarza 5 1,043 Sep-24-2023, 02:02 PM
Last Post: snippsat
  problem in import module from other folder akbarza 5 1,440 Sep-01-2023, 07:48 AM
Last Post: Gribouillis
  problem in using pyqrcode module to create QRcode akbarza 9 2,004 Aug-23-2023, 04:17 PM
Last Post: snippsat
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,524 Aug-07-2023, 05:32 AM
Last Post: DPaul

Forum Jump:

User Panel Messages

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