0

I'm trying to pack a script that contains these external imports:

import keyboards
import win32gui
from PIL import ImageGrab
import pytesseract

I have a virtual environment set up with PyCharm, so I make sure to add the site-packages directory to the -paths option when running pyinstaller.

I am at a loss for what to do now since this error has never been fully answered. Some other resources (here and here) say to simply uninstall and then reinstall all packages relating to win32. I did that, but it's still not successful. Any ideas?

Gabe Morris
  • 804
  • 4
  • 21

1 Answers1

1

After playing around with it for about an hour, I've come to a solution. I added --hidden-import "pywin32" to the pyinstaller command, and it worked! So if uninstalling and reinstalling doesn't work, try adding "pywin32" as a hidden import.

Gabe Morris
  • 804
  • 4
  • 21