我使用的是最新版本的pyinstaller,python 2.7.5,OSX
当我尝试打包这段代码时:
import Crypto.Cipher._AES as AES
import Crypto.Hash._SHA256 as SHA256
if __name__ == '__main__':
c = AES.new('1234567890123456')
cipher = c.encrypt('blabblabblabblab')
print(cipher.encode('hex'))
h = SHA256.new('blabblabblabblab')
print(h.hexdigest())
python pyinstaller.py /Users/alexey/secure_backup/cryptotest.py -F
成功,但是当我从控制台运行程序时出现此输出:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/alexey/Downloads/pyinstaller-develop/PyInstaller/loader/pyimod03_importers.py", line 382, in load_module
exec(bytecode, module.__dict__)
File "build/bdist.macosx-10.9-intel/egg/Crypto/Cipher/_AES.py", line 7, in <module>
File "build/bdist.macosx-10.9-intel/egg/Crypto/Cipher/_AES.py", line 6, in __bootstrap__
ImportError: dlopen(/var/folders/nd/1m2t9wmx4jv1gdw_h0s9sp3w0000gp/T/_MEI81X1du/Crypto/Cipher/_AES.so, 2): image not found
- hidden-import = Crypto.Cipher._AES也无法正常工作