This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jmoguill2
Recipients eryksun, jmoguill2, paul.moore, steve.dower, tim.golden, zach.ware
Date 2021-02-09.18:26:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMs=9yW9OZ6LodduzSg-pgzzu2oZzr1Jo_J5AmRET-7hxkUD_w@mail.gmail.com>
In-reply-to <1612844965.67.0.138996977709.issue43173@roundup.psfhosted.org>
Content
Thanks for the feedback

On Mon, Feb 8, 2021, 8:29 PM Eryk Sun <report@bugs.python.org> wrote:

>
> Eryk Sun <eryksun@gmail.com> added the comment:
>
> > What's the correct way to set the DLL search path when running a python
> script?
>
> If possible, the simplest approach is to put dependent DLLs in the same
> directory as the extension module.
>
> In 3.8+, the search path for the dependent DLLs of a normally imported
> extension module includes the following directories:
>
>     * the loaded extension module's directory
>     * the application directory (e.g. that of python.exe)
>     * the user DLL search directories that get added by
>       SetDllDirectory() and AddDllDirectory(), such as with
>       os.add_dll_directory()
>     * %SystemRoot%\System32
>
> Note that the above list does not include the current working directory or
> %PATH% directories.
>
> > It would be helpful if it listed the actual name of
> > the DLL that it cannot find.
>
> WinAPI LoadLibraryExW() doesn't have an out parameter to get the missing
> DLL or procedure name that caused the call to fail. All we have is the
> error code to report, such as ERROR_MOD_NOT_FOUND (126) and
> ERROR_PROC_NOT_FOUND (127). Using a debugger, you can see the name of the
> missing DLL or procedure if loader snaps are enabled for the application.
>
> ----------
> nosy: +eryksun
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue43173>
> _______________________________________
>
History
Date User Action Args
2021-02-09 18:26:07jmoguill2setrecipients: + jmoguill2, paul.moore, tim.golden, zach.ware, eryksun, steve.dower
2021-02-09 18:26:07jmoguill2linkissue43173 messages
2021-02-09 18:26:07jmoguill2create