Thanks for the tip. I started snooping around a little bit more and found 
that the ImportError was just giving me the basename of the missing 
package. What it really meant was that it couldn't import 
cryptography.hazmat.bindings.openssl.aes. So I ran the following command (I 
looked at what cryptography.hazmat.bindings was importing and added all the 
packages as hidden imports):

$ pyinstaller -dy --onefile testcase.py 
--hidden-import=cryptography.hazmat.bindings.openssl.aes 
--hidden-import=cryptography.hazmat.bindings.openssl.asn1 
--hidden-import=cryptography.hazmat.bindings.openssl.bignum 
--hidden-import=cryptography.hazmat.bindings.openssl.bio 
--hidden-import=cryptography.hazmat.bindings.openssl.cmac 
--hidden-import=cryptography.hazmat.bindings.openssl.cms 
--hidden-import=cryptography.hazmat.bindings.openssl.conf 
--hidden-import=cryptography.hazmat.bindings.openssl.crypto 
--hidden-import=cryptography.hazmat.bindings.openssl.dh 
--hidden-import=cryptography.hazmat.bindings.openssl.dsa 
--hidden-import=cryptography.hazmat.bindings.openssl.ec 
--hidden-import=cryptography.hazmat.bindings.openssl.ecdh 
--hidden-import=cryptography.hazmat.bindings.openssl.ecdsa 
--hidden-import=cryptography.hazmat.bindings.openssl.engine 
--hidden-import=cryptography.hazmat.bindings.openssl.err 
--hidden-import=cryptography.hazmat.bindings.openssl.evp 
--hidden-import=cryptography.hazmat.bindings.openssl.hmac 
--hidden-import=cryptography.hazmat.bindings.openssl.nid 
--hidden-import=cryptography.hazmat.bindings.openssl.objects 
--hidden-import=cryptography.hazmat.bindings.openssl.opensslv 
--hidden-import=cryptography.hazmat.bindings.openssl.osrandom_engine 
--hidden-import=cryptography.hazmat.bindings.openssl.pem 
--hidden-import=cryptography.hazmat.bindings.openssl.pkcs7 
--hidden-import=cryptography.hazmat.bindings.openssl.pkcs12 
--hidden-import=cryptography.hazmat.bindings.openssl.rand 
--hidden-import=cryptography.hazmat.bindings.openssl.rsa 
--hidden-import=cryptography.hazmat.bindings.openssl.ssl 
--hidden-import=cryptography.hazmat.bindings.openssl.x509 
--hidden-import=cryptography.hazmat.bindings.openssl.x509name 
--hidden-import=cryptography.hazmat.bindings.openssl.x509v3 
--hidden-import=cryptography.hazmat.bindings.openssl.x509_vfy

This actually fixed all the ImportError issues. However, now when I try to 
run the dist file, I get the following output:

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/_MEInVx8uJ
LOADER: executable is /tmp/env/testcase/dist/testcase
LOADER: homepath is /tmp/env/testcase/dist
LOADER: _MEIPASS2 is /tmp/_MEInVx8uJ
LOADER: archivename is /tmp/env/testcase/dist/testcase
LOADER: Already in the child - running user's code.
LOADER: Python library: /tmp/_MEInVx8uJ/libpython2.7.so.1.0
LOADER: Manipulating evironment
LOADER: PYTHONPATH=/tmp/_MEInVx8uJ
LOADER: PYTHONHOME=/tmp/_MEInVx8uJ
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 80, in build_ffi
  File "/tmp/env/testcase/build/testcase/out00-PYZ.pyz/cffi.api", line 340, 
in verify
  File "/tmp/env/testcase/build/testcase/out00-PYZ.pyz/cffi.verifier", line 
73, in load_library
  File "/tmp/env/testcase/build/testcase/out00-PYZ.pyz/cffi.verifier", line 
125, in _write_source
IOError: [Errno 20] Not a directory: 
'/tmp/env/testcase/build/testcase/out00-PYZ.pyz/__pycache__/_Cryptography_cffi_4ed9e37dx4000d087.c'
LOADER: RC: -1 from testcase
LOADER: OK.
LOADER: Cleaning up Python interpreter.
LOADER: Back to parent
LOADER: Doing cleanup
LOADER: Freeing archive status for /tmp/env/testcase/dist/testcase

It's still an issue but at least it's a new issue. I'll see if I can figure 
out what's going on.

On Monday, September 1, 2014 3:23:18 AM UTC-4, Hartmut Goebel wrote:
>
>  Hi,
>  
> Any help would be appreciated.
>
>
> Did you already follow the instructions at 
>    
>    - Read our FAQ <http://www.pyinstaller.org/wiki/FAQ> and have a look 
>    at the recipes <http://www.pyinstaller.org/wiki/Recipe>. 
>    - If your packed application does not run as expected, please read If 
>    Thing Go Wrong <http://www.pyinstaller.org/wiki/FAQ#IfThingsGoWrong>. 
>
> If you did, please have a look at HowtoReportBugs 
> <http://www.pyinstaller.org/wiki/HowtoReportBugs> for the information 
> needed for helping you.
>
> -- 
>  Schönen Gruß 
> Hartmut Goebel 
>  Dipl.-Informatiker (univ), CISSP, CSSLP
> Information Security Management, Security Governance, Secure Software 
> Development 
>
> Goebel Consult, Landshut 
> http://www.goebel-consult.de 
>
> Blog: 
> http://www.goebel-consult.de/blog/tr-069-auf-fritzbox-ausschalten-und-ergebnis-prufen
>  
> Kolumne: 
> http://www.cissp-gefluester.de/2011-08-horrorszenario-bring-your-own-device 
>
> Goebel Consult ist Mitglied bei http://www.7-it.de/ 
>  

-- 
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.

Reply via email to