Pyinstaller with pycrypto and paramiko

1,428 views
Skip to first unread message

Steeve BARBEAU

unread,
Aug 12, 2009, 11:19:12 AM8/12/09
to PyInstaller
Hello,

I'm trying to compile my python script with Pyinstaller but it failed.
I'm using the Pyinstaller trunc version. For your information, I
succeed in compiling a simple script without dependencies but when i
want to compile my script which depends of Paramiko and Pycrypto, it
failed.

My linux is in french, so when you read "Aucun fichier ou répertoire
de ce type", it means "No file or directory of this type". And
"paramiko_equ.py" is the name of my script, it's not Paramiko
itself ;)

Thanks to help me and sorry for my poor english.

[root@ADM_srv trunk]# python Build.py paramiko_equ/paramiko_equ.spec
checking Analysis
building because /var/www/html/site/scripts/paramiko_class.py changed
running Analysis outAnalysis0.toc
Analyzing: support/_mountzlib.py
Analyzing: support/useUnicode.py
Analyzing: /var/www/html/site/scripts/paramiko_equ.py
ldd: /usr/lib/python2.4/site-packages/pycrypto-2.0.1-py2.4-linux-
i686.egg/Crypto/Cipher/AES.so: Aucun fichier ou répertoire de ce type
ldd: /usr/lib/python2.4/site-packages/pycrypto-2.0.1-py2.4-linux-
i686.egg/Crypto/Cipher/Blowfish.so: Aucun fichier ou répertoire de ce
type
ldd: /usr/lib/python2.4/site-packages/pycrypto-2.0.1-py2.4-linux-
i686.egg/Crypto/Cipher/DES3.so: Aucun fichier ou répertoire de ce type
ldd: /usr/lib/python2.4/site-packages/pycrypto-2.0.1-py2.4-linux-
i686.egg/Crypto/Cipher/ARC4.so: Aucun fichier ou répertoire de ce type
ldd: /usr/lib/python2.4/site-packages/pycrypto-2.0.1-py2.4-linux-
i686.egg/Crypto/PublicKey/_fastmath.so: Aucun fichier ou répertoire de
ce type
Warnings written to paramiko_equ/warnparamiko_equ.txt
checking PYZ
building because toc changed
building PYZ outPYZ1.toc
checking PKG
building because outPKG3.toc missing or bad
building PKG outPKG3.pkg
Cannot find ('Crypto.Cipher.AES.so', '/usr/lib/python2.4/site-packages/
pycrypto-2.0.1-py2.4-linux-i686.egg/Crypto/Cipher/AES.so', 1, 'b')
Traceback (most recent call last):
File "Build.py", line 1153, in ?
main(args[0], configfilename=opts.configfile)
File "Build.py", line 1141, in main
build(specfile)
File "Build.py", line 1104, in build
execfile(spec)
File "paramiko_equ/paramiko_equ.spec", line 14, in ?
console=1 )
File "Build.py", line 654, in __init__
strip_binaries=self.strip, upx_binaries=self.upx,
crypt=self.crypt)
File "Build.py", line 554, in __init__
self.__postinit__()
File "Build.py", line 196, in __postinit__
self.assemble()
File "Build.py", line 611, in assemble
archive.build(self.name, mytoc)
File "/home/serveur/Desktop/trunk/archive.py", line 229, in build
self.add(tocentry) # the guts of the archive
File "/home/serveur/Desktop/trunk/carchive.py", line 235, in add
s = open(pathnm, 'rb').read()
IOError: [Errno 20] Not a directory: '/usr/lib/python2.4/site-packages/
pycrypto-2.0.1-py2.4-linux-i686.egg/Crypto/Cipher/AES.so'

Hans-Peter Jansen

unread,
Aug 12, 2009, 5:28:46 PM8/12/09
to PyIns...@googlegroups.com
Am Mittwoch, 12. August 2009 schrieb Steeve BARBEAU:
>
> My linux is in french, so when you read "Aucun fichier ou répertoire
> de ce type", it means "No file or directory of this type". And
> "paramiko_equ.py" is the name of my script, it's not Paramiko
> itself ;)
>
If you want to make such messages more palatable next time, try:

$ export LANG=C

in the session..

Can't help you with your issue, you may want to look into
paramiko_equ/warnparamiko_equ.txt and see, if you can make some sense of
it... BTW, did you check, if these libs exist?

Pete

Steeve BARBEAU

unread,
Aug 13, 2009, 4:50:02 AM8/13/09
to PyInstaller
> Can't help you with your issue, you may want to look into
> paramiko_equ/warnparamiko_equ.txt and see, if you can make some sense of
> it... BTW, did you check, if these libs exist?

Yes these libs exist because when i run the non-compiled script it's
works. The libs are here : /usr/lib/python2.4/site-packages/
paramiko-1.7.5-py2.4.egg and ..../pycrypto-2.0.1-py2.4-linux-i686.egg,
but in the warnparamiko_equ.txt file it search in "build/bdist.linux-
i686/egg/paramiko/__init__.pyc", i don't understand why.

In addition "build/bdist..." doesn't correspond to the architecture of
the .egg file. Egg file is composed by :
+EGG-INFO
- dependency_links.txt
- requires.txt
- top_level.txt
- PKG-INFO
- SOURCES.txt
- zip-safe

+paramiko
__init__.py
__init__.pyc
and lot of other files ..

Furthermore this error "IOError: [Errno 20] Not a directory: '/usr/lib/
python2.4/site-packages/pycrypto-2.0.1-py2.4-linux-i686.egg/Crypto/
Cipher/AES.so'" is strange because a egg file is not a directory and
pyinstaller try to access it like a directory.

Is there somebody wich succeed to compile a script using pycrypto with
pyinstaller ??

This is my warnparamiko_equ.txt file :

W: no module named win32api (delayed import by platform)
W: no module named win32pipe (delayed, conditional import by platform)
W: no module named msvcrt (conditional import by Crypto.Util.randpool)
W: no module named MacOS (delayed import by platform)
W: no module named Crypto.Util.Counter (top-level import by
paramiko.transport)
W: no module named msvcrt (conditional import by getpass)
W: no module named java (delayed import by platform)
W: no module named AES (delayed, conditional import by archive)
W: no module named vms_lib (delayed, conditional import by platform)
W: no module named msvcrt (delayed import by getpass)
W: no module named win32gui (top-level import by paramiko.win_pageant)
W: no module named Crypto.Util.winrandom (top-level import by
Crypto.Util.randpool)
W: no module named Crypto.Util.winrandom (top-level import by
paramiko.rng_win32)
W: no module named EasyDialogs (conditional import by getpass)
W: no module named win32con (delayed import by platform)
W: no module named ctypes (conditional import by paramiko.win_pageant)
W: no module named gestalt (delayed import by platform)
W: no module named r_hmac (top-level import by paramiko.packet)
W: no module named org (top-level import by copy)
W: no module named _emx_link (conditional import by os)
W: no module named Carbon (conditional import by tempfile)
W: __all__ is built strangely at line 0 - dis (/usr/lib/python2.4/
dis.pyc)
W: delayed exec statement detected at line 0 - bdb (/usr/lib/
python2.4/bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (/usr/lib/python2.4/
bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (/usr/lib/python2.4/
bdb.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (/
usr/lib/python2.4/doctest.pyc)
W: delayed exec statement detected at line 0 - doctest (/usr/lib/
python2.4/doctest.pyc)
W: __all__ is built strangely at line 0 - tokenize (/usr/lib/python2.4/
tokenize.pyc)
W: delayed __import__ hack detected at line 0 - encodings (/usr/lib/
python2.4/encodings/__init__.pyc)
W: __all__ is built strangely at line 0 - re (/usr/lib/python2.4/
re.pyc)
W: delayed conditional __import__ hack detected at line 0 -
Crypto.Util.randpool (build/bdist.linux-i686/egg/Crypto/Util/
randpool.pyc)
W: name SSHConfig not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name HostKeys not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name AgentKey not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name Agent not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name BufferedFile not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name ServerInterface not found - paramiko (build/bdist.linux-i686/
egg/paramiko/__init__.pyc)
W: name SFTPServerInterface not found - paramiko (build/bdist.linux-
i686/egg/paramiko/__init__.pyc)
W: name SFTPAttributes not found - paramiko (build/bdist.linux-i686/
egg/paramiko/__init__.pyc)
W: name SFTPError not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name SFTPServer not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name SFTPClient not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name SFTPHandle not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name SFTPFile not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name SFTP not found - paramiko (build/bdist.linux-i686/egg/paramiko/
__init__.pyc)
W: name BadHostKeyException not found - paramiko (build/bdist.linux-
i686/egg/paramiko/__init__.pyc)
W: name ChannelException not found - paramiko (build/bdist.linux-i686/
egg/paramiko/__init__.pyc)
W: name BadAuthenticationType not found - paramiko (build/bdist.linux-
i686/egg/paramiko/__init__.pyc)
W: name PasswordRequiredException not found - paramiko (build/
bdist.linux-i686/egg/paramiko/__init__.pyc)
W: name AuthenticationException not found - paramiko (build/
bdist.linux-i686/egg/paramiko/__init__.pyc)
W: name SSHException not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name Message not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name DSSKey not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name RSAKey not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name PKey not found - paramiko (build/bdist.linux-i686/egg/paramiko/
__init__.pyc)
W: name Channel not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name SubsystemHandler not found - paramiko (build/bdist.linux-i686/
egg/paramiko/__init__.pyc)
W: name SecurityOptions not found - paramiko (build/bdist.linux-i686/
egg/paramiko/__init__.pyc)
W: name WarningPolicy not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name RejectPolicy not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name AutoAddPolicy not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name MissingHostKeyPolicy not found - paramiko (build/bdist.linux-
i686/egg/paramiko/__init__.pyc)
W: name SSHClient not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: name Transport not found - paramiko (build/bdist.linux-i686/egg/
paramiko/__init__.pyc)
W: delayed conditional eval hack detected at line 0 - warnings (/usr/
lib/python2.4/warnings.pyc)
W: delayed conditional __import__ hack detected at line 0 - warnings (/
usr/lib/python2.4/warnings.pyc)
W: delayed exec statement detected at line 0 - pdb (/usr/lib/
python2.4/pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (/usr/lib/
python2.4/pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (/usr/lib/python2.4/
pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (/usr/lib/
python2.4/pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (/usr/lib/python2.4/
pdb.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest (/
usr/lib/python2.4/unittest.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest (/
usr/lib/python2.4/unittest.pyc)
W: delayed conditional exec statement detected at line 0 - iu (/home/
serveur/Desktop/trunk/iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (/home/
serveur/Desktop/trunk/iu.pyc)
W: delayed exec statement detected at line 0 - socket (/usr/lib/
python2.4/socket.pyc)
W: delayed eval hack detected at line 0 - os (/usr/lib/python2.4/
os.pyc)
W: __all__ is built strangely at line 0 - __future__ (/usr/lib/
python2.4/__future__.pyc)

Steeve BARBEAU

unread,
Aug 13, 2009, 1:28:52 PM8/13/09
to PyInstaller
I've found a solution, i've extract the 2 egg files directories named
like the egg files (with .egg extension) and it works ;)

If it's bad, and if you know a better solution please tell me :p
Reply all
Reply to author
Forward
0 new messages