curl-and-python

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

From: Oleg Pudeyev <oleg+pycurl_at_bsdpower.com>
Date: Fri, 16 May 2014 22:44:54 -0400

The log has been very helpful - I believe I see the problem.

First, the reason why official pycurl windows packages do not include
msvcr90.dll or its variants, is that that library is expected to be
already loaded in the process by the time pycurl is loaded.

Python is linked against some version of msvcrt. The python 2.7 build
you can download from python.org links against msvcr90.dll. Thus,
pycurl links against the same library.

Using pycurl linked against one crt with python linked against another
crt will either not work at all or will produce subtle bugs/crashes in
some scenarios. Short version: pycurl must be compiled against the same
crt python, and libcurl, are compiled against. This might require
libcurl to be recompiled against whatever crt python was compiled
against.

Now, in the log I see this line:

Loaded "MSVCRT.DLL" at address 0x76D80000. Successfully hooked module.

That's the crt that python is compiled against. Note it is not
msvcr90.dll. Thus either your python is built with a different msvc
version than the official builds are built with, or your msvcrt is
somehow renamed. Either way, you can't use an official pycurl build
with this python build.

To confirm, find out which msvc version your python was built with. If
you did not build python yourself, you might need to figure out who did
build it and ask them.

Are you running an official python build? If not, try downloading and
installing one. I expect a 32 bit build/installer to function correctly
on a 64 bit system. Alternatively you will probably have to recompile
pycurl. Have a look at INSTALL.rst which has a windows section.

Disclaimer: above was all a thought experiment and I might be wrong.

Regards,
Oleg

On Thu, 15 May 2014 10:12:24 -0500
Jim Bell <Jim_at_jc-bell.com> wrote:

>
> On 2014-05-15 1:38 AM, Dima Tisnek wrote:
> > http://www.dependencywalker.com/help/html/application_profiling.htm
> >
> > there you go :)
>
> Wow! Super-cool! Thanks. (For the record, though I'm running
> Windows7 x64, I need the 32-bit version of depends.exe to profile a
> 32-bit python.exe.)
>
> The offending call is the second call to LoadLibraryExA:
>
> LoadLibraryExA("c:\software\python27x86\lib\site-packages\pycurl.pyd",
> 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: The
> specified procedure could not be found (127).
>
> The first call, which appears the same, succeeds.
>
> Full log: http://pastebin.com/a0SSatg5
>
>
> >
> > On 14 May 2014 20:12, Jim Bell <Jim_at_jc-bell.com> wrote:
> >> On 2014-05-14 11:35 AM, Dima Tisnek wrote:
> >>
> >> IIRC depends can be used to trace symbol resolution in a running
> >> program too.
> >>
> >>
> >> I don't see that capability. I've never seen it here, though I see
> >> the functions in the .dll.
> >>
> >>
> ...
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2014-05-17