问题
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