Python: ImportError from compiled source code

给你一囗甜甜゛ 提交于 2019-12-10 15:54:06

问题


I'm having problems while running a compiled source code. The code itself is correct and if I run python file.py everything goes fine; if I compile it with pyinstaller or software like this, and then I run the compiled file it says ImportError: No module named _cffi_backend. But when I open python and import cffi and/or _cffi_backend python doesn't show error. Investigating in my code I found that the problem is just with padding from cryptography, so if I don't import padding the output doesn't show errors (obviously errors comes because the code doesn't work well without padding module). Can someone help me?


回答1:


I just ran into this issue as well.

What worked for me was adding in --hidden-import=_cffi_backend option when building with pyinstaller.



来源:https://stackoverflow.com/questions/33982598/python-importerror-from-compiled-source-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!