Dll Load Failure With Py2exe (python And Qt)

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 21, 2009, 07:32 PM
430562 members and 297703 Topics
Latest Member: Emmysweet
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Dll Load Failure With Py2exe (python And Qt)
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Dll Load Failure With Py2exe (python And Qt)  (Read 145 views)
webdezzi (m)
Dll Load Failure With Py2exe (python And Qt)
« on: September 19, 2009, 10:21 AM »

i've been trying to figure out where the problem lies with no clue yet.
i am getting ImportError: DLL load failed: the specified procedure could not be found.

i smell the problem is from py2exe
and this is what i have in the setup file

Quote
from distutils.core import setup
import py2exe

setup(windows=[{"script":"npmcnp.py","icon_resources":[(1,"npmcn.ico")]}], options={"py2exe":{"includes":["sip","PyQt4._qt"],'bundle_files': 1}})

i have tried options 2 and 3 also for the bundle_files parameter with no luck.
the DLL it failed to load is psycopg2, psycopg2 is one of the modules needed to run the application
pc guru (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #1 on: September 19, 2009, 02:06 PM »

Guy i respect you.You already coding in Qt.Would love to learn that.Join thier forum and ask for help.Qt is the future
pc guru (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #2 on: September 19, 2009, 02:08 PM »

Guy i respect you.You already coding in Qt.Would love to learn that.Join thier forum and ask for help.Qt is the future
jacob05 (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #3 on: September 19, 2009, 10:56 PM »

Had TheSame problem
*dhtml (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #4 on: September 20, 2009, 12:43 PM »

Ehm, permission to shoot my maut hia. . . .while i dont know python or what the heck Qt means!
I have some experience with creating and loading DLLs both in C++, Visual Basic, PHP and even loading it on msdos commandline sef.

One thing i have come to realize is that there are many ways of loading DLLs into applications. I am aware of static linkage and dynamic
linkage. So many platforms usually have more than one method of loading DLLs. For instance the dl function in php will fail if the DLL does
not have an iDispatch interface. . . .so for that particular dll you are having issues with loading, go and lookup the documentation of your
language and see how it is implemented. I will not be quick to believe that those DLLs are corrupt. Or better still, try to see if you can get
a sample working code of the implementation of those DLLs from somewhere.
pc guru (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #5 on: September 20, 2009, 01:55 PM »

Dhtml guy why the absence from nairaland don't you know pple dey look up to ya.How you doing.
pc guru (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #6 on: September 20, 2009, 01:55 PM »

Dhtml guy why the absence from nairaland don't you know pple dey look up to ya.How you doing.
*dhtml (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #7 on: September 20, 2009, 06:03 PM »

I have been around, just had to reduce my posts 'cos i had loads of work to do. My desk is partially cleared for now.
*dhtml (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #8 on: September 22, 2009, 09:21 AM »

Please o, if anyone has found the solution, it will be nice to post it here so that we can all learn. By the way, i just created a php extension with microsoft c++ 6.0 i called it php_hello.dll and it just shows hello world, i am interested in discussing with anyone else knowlegeable in this area. But not on this thread please. DLLs are rather tough areas sometimes.
webdezzi (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #9 on: October 14, 2009, 07:03 PM »

I found it,
the problem is from py2exe adding 2 extra dlls from my Vista, the target machines are 2000/xp/vista
so things works fine on vista while 2000/xp complains of not seeing psycopg2\_psycopg.pyc even though it's there

here is the error,

>> Traceback (most recent call last):
>>   File "npmcn.py", line 2, in <module>
>>   File "psycopg2\__init__.pyc", line 60, in <module>
>>   File "psycopg2\_psycopg.pyc", line 12, in <module>
>>   File "psycopg2\_psycopg.pyc", line 10, in __load
>> ImportError: DLL load failed: The specified procedure could not be found.


i just figured Vista keeps shipping something with my app thats not needed or not compatible with other windows version
excluding 2 dlls from the zip did the trick

so 2000/xp kept using the vista version instead of using the native one located in the windows' system32 folder
the too naughty dlls are Secur32.dll and SHFOLDER.dll

i also figured out that py2exe has a way you can exclude dlls
 "dll_excludes": ["whatever.dll"]
you will need to add it to the options' argument like below




excludes = ["Secur32.dll", "SHFOLDER.dll"]
setup(
    options = {"py2exe": {"includes":["sip","PyQt4._qt"],
         "compressed": 1,
                          "optimize": 2,
                          "ascii": 1,
                          "bundle_files": 1,
                          "dll_excludes": excludes
                          }},
    zipfile = None,
    windows = [test_wx],
    )

this gave me headache for almost a month, how i wish someone has experienced and posted something like this.
*dhtml (m)
Re: Dll Load Failure With Py2exe (python And Qt)
« #10 on: October 16, 2009, 04:31 AM »

well, i guess someone has to lead the way
  I Need Help!  Just Mention The Material You Want In It World  Drupal Programming  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.