我使用PyInstaller通过以下命令将包含模块的python文件转换为一个可执行文件:
pyinstaller --onedir --onefile --name=IFSCP "C:\Python27\main.py"
我没有使用前缀窗口,因为Python程序处于控制台模式。
编译一切顺利,但在打开可执行文件时有一个问题。加载可执行文件时出现以下错误:
Traceback (most recent call last):
File "main.py", line 13 in <module>
File "C:\Users\Youri Kool\Desktop\pyinstaller-pyinstaller-8689a5d\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
exec(bytecode, module, __dict__)
File "c:\users\yourik~1\appdata\local\temp\easy_install-gzievh\pycrypto-2.6.1-py2.7-win32.egg.tmp\Crypto\Cipher\AES.py", line 50, in <module>
File "C:\Users\Youri Kool\Desktop\pyinstaller-pyinstaller-8689a5d\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
exec(bytecode, module, __dict__)
File "c:\users\yourik~1\appdata\local\temp\easy_install-gzievh\\pycrypto-2.6.1-py2.7-win32.egg.tmp\Crypto\Cipher\_AES.py", line 7 in <module>
File "c:\users\yourik~1\appdata\local\temp\easy_install-gzievh\\pycrypto-2.6.1-py2.7-win32.egg.tmp\Crypto\Cipher\_AES.py", line 6 in __bootstrap__
ImportError:DLL加载失败:Kan opgegeven模块niet vinden。在
Kan opgegeven模块niet vinden。->;找不到模块
如果没有
from Crypto.Cipher import AES
在剧本里。在
调试信息:
^{pr2}$我安装了以下应用程序:
Pyinstaller Pyinstaller-Pyinstaller-8689a5d(开发人员)和Pyinstaller-3.2给出了相同的错误。在
我将
from Crypto.Cipher import AES
替换为import Crypto
。然后在代码中:我的.exe运行得很好
相关问题 更多 >
编程相关推荐