ModuleNotFoundError: No module named 'Crypto' & ModuleNotFoundError: No module named 'json' #5938
-
my appMain.py import part code as: in MainWindow.py , import part code as: I use Cython to build MainWindow.py to MainWindow.pyd Then use Pyinstaller to build exe file. But Failed to execute, and tips Error as title. I have try create hooks-Crypto.py and put it to hooks dir. Then use --additional-hooks-dir hooks in pyinstaller cmd. But it don't works. My appMain.spec file content as:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
PyInstaller cannot analyze pyd extensions and therefore cannot automatically pick up the imports made within them. So you'll have to add any imports made within your MainWindow.pyd (and not within any other .py file) to |
Beta Was this translation helpful? Give feedback.
PyInstaller cannot analyze pyd extensions and therefore cannot automatically pick up the imports made within them. So you'll have to add any imports made within your MainWindow.pyd (and not within any other .py file) to
hiddenimports
- in your case, that would bejson
andCrypto.Cipher
(or perhapsCrypto.Cipher.AES
).