gnikit / tkinter-tooltip

A ToolTip widget for tkinter
https://gnikit.github.io/tkinter-tooltip
MIT License
41 stars 4 forks source link

Pyinstaller doesn't find the module. #23

Closed herpaderpader closed 11 months ago

herpaderpader commented 2 years ago

As soon I create with "Pyinstaller/auto-py-to-exe" an ".exe" file from my script, it stops working. The module is not found it says:

Traceback (most recent call last):
  File "tktooltip\version.py", line 6, in <module>
  File "importlib\metadata.py", line 531, in version
  File "importlib\metadata.py", line 504, in distribution
  File "importlib\metadata.py", line 177, in from_name
importlib.metadata.PackageNotFoundError: tkinter-tooltip

I checked it, the module is definitely there under "\Lib\site-packages".

I tried adding it as "--hidden-import", didn't help. I tried adding additional "path", didn't help.

gnikit commented 2 years ago

So how are you installing tkinter-tooltip and what version of python are you using?

herpaderpader commented 2 years ago

Python 3.10.1 on Windows 10

The following way: ToolTip(nameofthebutton, msg="My message comes here.", follow=True)

It works perfectly as long as I don't create an .exe file from it. Then the exe crashes. I see that when I create the exe file pyinstaller does not find the module even though it's there.

gnikit commented 2 years ago

I meant are you installing it from source or with pip?

Basically, you are missing setuptools_scm see the pyproject.toml. These are the build dependencies of the tooltip.

If you are using pip you should have to worry about them and the tooltip should just work.

herpaderpader commented 2 years ago

I'm using pip. I have "setuptools_scm".

gnikit commented 2 years ago

I had another look at the error message being thrown and I don't think it's related to tkinter-tooltip. If you can go into a Python interpreter and print the tktooltip.__version__ that means that there is something wrong with auto-py-to-exe.

tkinter-tooltip uses scm and scm_git for builds and source builds respectively.

herpaderpader commented 2 years ago

Yeah I was able to print it. Still cannot create a functional exe file. I will try it on a different computer, maybe it is the computer.

RunsOnRum commented 1 year ago

I seem to be having somewhat related issues. I'm using Pycharm, CustomTkinter, along with tktooltip. I first get a message stating that setuptools_scm is missing, then packaging is missing, then errors out on unable to find version of my project.

tktooltip has been compiling inside the IDE without issue, without setuptools_scm and packaging.

I am a novice, so the usage of tktooltip is out of my depth if it doesn't work with just including the package path in pyinstaller with --add-data.

Is there any direction that you could possibly give me to get tktooltip to work with pyinstaller? All versions are the latest.

gnikit commented 11 months ago

From the looks of it, this is external to this project. I have updated to the latest setuptools_scm in release 2.2.0 but other than that there is not much else I can do from my side.