#149: packed binary tries to import all the .py files in the current directory
------------------------------+---------------------------------------------
 Reporter:  mrk...@…          |       Owner:  giovannibajo   
     Type:  defect            |      Status:  new            
 Priority:  normal            |   Milestone:  PyInstaller 1.4
Component:  PyInstaller       |     Version:  PyInstaller 1.4
 Severity:  major             |    Keywords:                 
------------------------------+---------------------------------------------
 I have a packed binary, cssh:

 Linux RH [17:35] root /var/www/html # ./cssh
 Traceback (most recent call last):
   File "<string>", line 19, in ?
   File "/var/www/html/pyinstaller-py2.4/iu.py", line 439, in importHook
     mod = _self_doimport(nm, ctx, fqname)
   File "/var/www/html/pyinstaller-py2.4/iu.py", line 524, in doimport
     exec co in mod.__dict__
   File "/var/www/html/warnings.py", line 3, in ?
     from hosts_sqla import Host, Architecture, OS_Kind, OS_version, Email,
 Virtualization, session
   File "/var/www/html/pyinstaller-py2.4/iu.py", line 439, in importHook
     mod = _self_doimport(nm, ctx, fqname)
   File "/var/www/html/pyinstaller-py2.4/iu.py", line 524, in doimport
     exec co in mod.__dict__
   File "./hosts_sqla.py", line 3, in ?
     from sqlalchemy import create_engine, Table, Column, String, Integer,
 MetaData, ForeignKey, desc, asc, and_, or_
   File "/var/www/html/pyinstaller-py2.4/iu.py", line 458, in importHook
     raise ImportError, "No module named %s" % fqname
 ImportError: No module named sqlalchemy

 The cssh.py script / cssh packed binary does NOT rely on module
 sqlalchemy. Instead, I have a script "warnings.py" in /var/www/html that
 makes use of sqlalchemy module. When ran from /var/www/html, cssh binary
 imports warnings.py located there for no reason apparent to me.

 This results in exceptions instead of normal program functioning.

 I have even deleted all the nonstandard directories from sys.path:

 sys.path = [ p for p in sys.path if p.startswith('/usr/lib') ]

 But the packed binary with the code above still tries to import other
 scripts. Obviously, normal script (cssh.py) does not do that.

-- 
Ticket URL: <http://www.pyinstaller.org/ticket/149>
Pyinstaller <http://www.pyinstaller.org>
PyInstaller Project

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to