简体   繁体   中英

PyInstaller can't find module

I'm trying to package a test Python project using PyInstaller. The full source is available at https://github.com/xilanma/ohoh

All it does is import the aes and ecdsa module. When trying to package on Windows using PyInstaller, it builds the .exe but when I launch the .exe, I get the following error:

C:\Users\ixcoin\dev\ohoh\dist>ohoh.exe
trying to import aes
Traceback (most recent call last):
  File "<string>", line 4, in <module>
ImportError: No module named aes

The full log is available at https://github.com/xilanma/ohoh/blob/master/README.md#some-logs

Does anyone know how to fix that problem? I'm testing using Windows 7 x86 in VirtualBox.

I was having a similar issue being unable to import AES when using importing PyOpenSSL. AES was a hidden import that pyinstaller kept missing. This google groups post led me to the solution of using the develop branch of PyInstaller. A hidden imports file has been included in this branch that finds AES and includes it.

I did this by downloading the zip of the develop branch and unzipping it. PyInstaller could then be used with the following command:

python pyinstaller.py C:\path\to\my\script.py

All of the commands that come with the pip package can be used with the command above.

I hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM