Hi David,
     This issue bother me for almost 2 weeks.

If you'd follow your debugging guide line you'd have solved it already. SCNR. I suggest reading the manual

I still have to guess, what is the problem. I assume:

1) PyInstaller does not bundle you modules in `app/controllers`. It looks as if you solved this by using the development branch and hiddenimports.

2) Now you frozen application does not find the modules. This a *very* different problem.

[sample code]
  g = globals()
modules = [] for strPath, lstDirs, lstFiles in os.walk(controllers_dir):

         if lstFiles == []:
             continue
modules.extend([(f[:-3], os.path.join(strPath, f)) for f in lstFiles if f.endswith('.py')])

for (name, file) in modules:
    if name not in g:
             import_module(name, file)

def import_module(name, file):
         m = load_source(name, file)
     g[name] = m

This code can not work in your frozen app for several reasons:

 * modules are held within th PYZ archive and are not extracted to the
   filesystem (neither in --onefile nor in --onedir mode)
 * module in the PYZ are name like `app.controllers.foo` (nut
   `app/controllers/foo.py`


You are talking about `find_module`, but there is no `find_module` in this code?! What `find_module` do you mean at all?

   File "/opt/buildengr/build/pyi.linux2/application/out01-PYZ.pyz/web.db", 
line 1007, in import_driver
ImportError: Unable to import sqlite3 or pysqlite2.dbapi2 or sqlite

This seams to be yet another, unrelated problem: sqlite is missing. You you need to check if its in the PYZ and how to get it there.

so the issue is so weird now, if i used release version, running executable is 
OK but can not import some modules and find_module;  if i used development 
version, running executable throws exception but can import modules, still 
can't fine_module.

To be frank: the issue is not weird at all. You are trying to solve quite different problem at once. This is why we wrote the guideline at http://www.pyinstaller.org/wiki/FAQ#IfThingsGoWrong.


--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP

Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de

Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult ist Mitglied bei http://www.7-it.de

Attachment: smime.p7s
Description: S/MIME Kryptografische Unterschrift

Reply via email to