简体   繁体   中英

python error ImportError: DLL load failed: The specified procedure could not be found. File “psycopg2\_psycopg.pyc”, line 10, in __load

I packaged a Windows application developped in python. For the setup, no problem. When launching it up on my PC (let's say PC1), no problem. But when trying to launch it on another PC (let's say PC2), an error message shows up indicating to read the MYAPPLICATION.exe.log file. There s 1 error (only 1), here are the lines of the log :

File "MYAPPLICATION.pyc", line 9, in

File "psycopg2__init__.pyc", line 50, in

File "psycopg2_psycopg.pyc", line 12, in

File "psycopg2_psycopg.pyc", line 10, in __load

ImportError: DLL load failed: The specified procedure could not be found.

Indications about my way of packaging :

  • i used the command "setup.py py2exe --includes sip" (with the proper setup.py file) then InnoSetupCompiler.
  • I embedded both folders 'dist' and 'build'. I even copied the
    psycopg2 folder from site-packages to 'dist' (as well as mpl-data for matplotlib btw for which one i have no problem) before packaging
    with InnoSetup, so that i'm sure the module psycopg2 is well present on the PC2. But when I try to run it on the PC2 which occurs the
    error. Indications about PC2 : it has the python modules already
    installed on. (including the last version of psycog2)

So why does the psycog2 module import fails here ? Thanks.

"There are 2 DLLs that are required by pyscopg.pyd (secur32.dll & shfolder.dll) that are OS dependent." Removing them should do the trick. I got this solution from here: http://psycopg.initd.narkive.com/FX7WIxE6/import-error-using-psycopg2-with-py2exe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM