I've got a project that depends on pyOpenSSL which I'm currently using
pyinstaller to package into one file. I've got a simple test case that
consistently breaks on my machine. In a clean virtual environment:
$ pip install pyinstaller pyOpenSSL
$ pip install --pre slowaes
Then I make testcase.py:
import OpenSSL
print "test"
I package the above file with
$ pyinstaller -dy --onefile testcase.py
Running the file dist file returns the following:
$ dist/testcase
LOADER: executable is /tmp/env/testcase/dist/testcase
LOADER: homepath is /tmp/env/testcase/dist
LOADER: _MEIPASS2 is /tmp/_MEIrYnqaN
LOADER: archivename is /tmp/env/testcase/dist/testcase
LOADER: Already in the child - running user's code.
LOADER: Python library: /tmp/_MEIrYnqaN/libpython2.7.so.1.0
LOADER: Manipulating evironment
LOADER: PYTHONPATH=/tmp/_MEIrYnqaN
LOADER: PYTHONHOME=/tmp/_MEIrYnqaN
LOADER: Manipulating Python's sys.path
LOADER: importing modules from CArchive
LOADER: extracted struct
LOADER: extracted pyi_os_path
LOADER: extracted pyi_archive
LOADER: extracted pyi_importers
LOADER: Installing import hooks
LOADER: out00-PYZ.pyz
LOADER: Running scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/share/pyinstaller/PyInstaller/loader/pyi_importers.py", line
270, in load_module
exec(bytecode, module.__dict__)
File "/tmp/env/testcase/build/testcase/out00-PYZ.pyz/OpenSSL", line 8, in
<module>
File "/usr/share/pyinstaller/PyInstaller/loader/pyi_importers.py", line
270, in load_module
exec(bytecode, module.__dict__)
File "/tmp/env/testcase/build/testcase/out00-PYZ.pyz/OpenSSL.rand", line
11, in <module>
File "/usr/share/pyinstaller/PyInstaller/loader/pyi_importers.py", line
270, in load_module
exec(bytecode, module.__dict__)
File "/tmp/env/testcase/build/testcase/out00-PYZ.pyz/OpenSSL._util", line
4, in <module>
File
"/tmp/env/testcase/build/testcase/out00-PYZ.pyz/cryptography.hazmat.bindings.openssl.binding",
line 89, in __init__
File
"/tmp/env/testcase/build/testcase/out00-PYZ.pyz/cryptography.hazmat.bindings.openssl.binding",
line 109, in _ensure_ffi_initialized
File
"/tmp/env/testcase/build/testcase/out00-PYZ.pyz/cryptography.hazmat.bindings.utils",
line 47, in build_ffi
ImportError: No module named aes
LOADER: RC: -1 from testcase
LOADER: OK.
LOADER: Cleaning up Python interpreter.
LOADER: executable is /tmp/env/testcase/dist/testcase
LOADER: homepath is /tmp/env/testcase/dist
LOADER: _MEIPASS2 is NULL
LOADER: archivename is /tmp/env/testcase/dist/testcase
LOADER: Extracting binaries
LOADER: Executing self as child
LOADER: LD_LIBRARY_PATH=/tmp/_MEIrYnqaN
LOADER: Back to parent
LOADER: Doing cleanup
LOADER: Freeing archive status for /tmp/env/testcase/dist/testcase
I don't think the entirety of the above is necessary, but I've included it
all just in case. The most important part here is the import error. The aes
import is provided by the slowaes package. Adding --hidden-import=aes
doesn't change the error at all but it does actually add the tuple ('aes',
'C:\\Python\\new_env\\lib\\site-packages\\aes.pyc', 'PYMODULE') to the
build/testcase/out00-Analysis.toc file. This problem is exactly the same in
Windows and Linux.
I have no clue why this problem persists despite the apparent fulfillment
of pyOpenSSL's dependencies. Any help would be appreciated.
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.