classification
Title: Which module could not be found?
Type: enhancement Stage: test needed
Components: Interpreter Core, Windows Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Phillip.M.Feldman@gmail.com, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
Priority: normal Keywords: easy (C)

Created on 2019-03-11 21:43 by Phillip.M.Feldman@gmail.com, last changed 2019-03-15 18:34 by terry.reedy.

Messages (7)
msg337698 - (view) Author: Phillip M. Feldman (Phillip.M.Feldman@gmail.com) Date: 2019-03-11 21:43
I have a module that contains an import statement that imports a large number of items.  This import was failing with the following error message:

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

The message would be so much more helpful if it named the offending DLL and module.
msg337757 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-12 15:42
I agree. Unfortunately, the operating system does not provide this information.

The best I can offer is to run Process Monitor [1] and watch its logs. It should show the paths it attempts to access.

[1]: http://technet.microsoft.com/en-us/sysinternals/bb896645
msg337861 - (view) Author: Phillip M. Feldman (Phillip.M.Feldman@gmail.com) Date: 2019-03-13 16:40
Hello Steve,

I'm buying only 50 percent of this.  The Python interpreter must know what
module it was trying to import, and can at least be able to report that.

Phillip

On Tue, Mar 12, 2019 at 8:42 AM Steve Dower <report@bugs.python.org> wrote:

>
> Steve Dower <steve.dower@python.org> added the comment:
>
> I agree. Unfortunately, the operating system does not provide this
> information.
>
> The best I can offer is to run Process Monitor [1] and watch its logs. It
> should show the paths it attempts to access.
>
> [1]: http://technet.microsoft.com/en-us/sysinternals/bb896645
>
> ----------
> resolution:  -> third party
> stage:  -> resolved
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue36266>
> _______________________________________
>
msg337870 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-13 19:28
You mean like this:

>>> import _ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.

Should include "_ssl" somewhere in the message? That's easy enough, but it's never been what anyone else has meant when they've asked for this, so I assumed you wanted the more helpful message (where it tells you exactly which DLL is missing - libcrypto-1_1-x64.dll in this case - and *that's* the one we can't do).
msg337898 - (view) Author: Phillip M. Feldman (Phillip.M.Feldman@gmail.com) Date: 2019-03-14 06:47
'Should include "_ssl" somewhere in the message?'  Exactly so.  If a given
import statement imports 30 items, it would be helpful to know which one
caused the hickup.  Thanks!

On Wed, Mar 13, 2019 at 12:28 PM Steve Dower <report@bugs.python.org> wrote:

>
> Steve Dower <steve.dower@python.org> added the comment:
>
> You mean like this:
>
> >>> import _ssl
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: DLL load failed: The specified module could not be found.
>
> Should include "_ssl" somewhere in the message? That's easy enough, but
> it's never been what anyone else has meant when they've asked for this, so
> I assumed you wanted the more helpful message (where it tells you exactly
> which DLL is missing - libcrypto-1_1-x64.dll in this case - and *that's*
> the one we can't do).
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue36266>
> _______________________________________
>
msg337918 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-03-14 14:27
Okay, in that case we're just adding `shortname` into the formatted `message` in _PyImport_FindSharedFuncptrWindows in Python/dynload_win.c

I've marked this as "easy (C)" as it seems like a good first contribution for someone.
msg338013 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-03-15 18:34
Phillip, when responding by email, please removed the quoted email (except possible for a line or 2) as it becomes noise when your email is placed on the web page.  You can see the effect on https://bugs.python.org/issue36266
History
Date User Action Args
2019-03-15 18:34:17terry.reedysetnosy: + terry.reedy
messages: + msg338013
2019-03-14 14:27:27steve.dowersetstatus: closed -> open

versions: + Python 3.8, - Python 3.6
keywords: + easy (C)
messages: + msg337918
type: enhancement
resolution: third party ->
stage: resolved -> test needed
2019-03-14 06:47:34Phillip.M.Feldman@gmail.comsetmessages: + msg337898
2019-03-13 19:28:32steve.dowersetmessages: + msg337870
2019-03-13 16:40:10Phillip.M.Feldman@gmail.comsetmessages: + msg337861
2019-03-12 15:42:15steve.dowersetstatus: open -> closed
resolution: third party
messages: + msg337757

stage: resolved
2019-03-12 10:50:37xtreaksetnosy: + paul.moore, tim.golden, zach.ware, steve.dower
components: + Windows
2019-03-11 21:43:32Phillip.M.Feldman@gmail.comcreate