Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which module could not be found? #80447

Closed
PhillipMFeldman mannequin opened this issue Mar 11, 2019 · 12 comments
Closed

Which module could not be found? #80447

PhillipMFeldman mannequin opened this issue Mar 11, 2019 · 12 comments
Labels
3.8 only security fixes easy interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-windows type-feature A feature request or enhancement

Comments

@PhillipMFeldman
Copy link
Mannequin

PhillipMFeldman mannequin commented Mar 11, 2019

BPO 36266
Nosy @terryjreedy, @pfmoore, @tjguk, @Phillip_M_Feldman, @zware, @zooba, @miss-islington, @shireenrao
PRs
  • bpo-36266: Add module name in ImportError when DLL not found on Windows #15180
  • [3.8] bpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180) #15324
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-08-17.20:53:46.318>
    created_at = <Date 2019-03-11.21:43:32.442>
    labels = ['interpreter-core', 'easy', 'type-feature', '3.8', 'OS-windows']
    title = 'Which module could not be found?'
    updated_at = <Date 2019-08-17.21:11:31.226>
    user = 'https://github.com/PhillipMFeldman'

    bugs.python.org fields:

    activity = <Date 2019-08-17.21:11:31.226>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-17.20:53:46.318>
    closer = 'steve.dower'
    components = ['Interpreter Core', 'Windows']
    creation = <Date 2019-03-11.21:43:32.442>
    creator = 'Phillip.M.Feldman@gmail.com'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36266
    keywords = ['patch', 'easy (C)']
    message_count = 12.0
    messages = ['337698', '337757', '337861', '337870', '337898', '337918', '338013', '349244', '349573', '349906', '349907', '349908']
    nosy_count = 8.0
    nosy_names = ['terry.reedy', 'paul.moore', 'tim.golden', 'Phillip.M.Feldman@gmail.com', 'zach.ware', 'steve.dower', 'miss-islington', 'shireenrao']
    pr_nums = ['15180', '15324']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue36266'
    versions = ['Python 3.8']

    @PhillipMFeldman
    Copy link
    Mannequin Author

    PhillipMFeldman mannequin commented Mar 11, 2019

    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.

    @PhillipMFeldman PhillipMFeldman mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 11, 2019
    @zooba
    Copy link
    Member

    zooba commented Mar 12, 2019

    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.

    @zooba zooba closed this as completed Mar 12, 2019
    @PhillipMFeldman
    Copy link
    Mannequin Author

    PhillipMFeldman mannequin commented Mar 13, 2019

    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.

    ----------
    resolution: -> third party
    stage: -> resolved
    status: open -> closed


    Python tracker <report@bugs.python.org>
    <https://bugs.python.org/issue36266\>


    @zooba
    Copy link
    Member

    zooba commented Mar 13, 2019

    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).

    @PhillipMFeldman
    Copy link
    Mannequin Author

    PhillipMFeldman mannequin commented Mar 14, 2019

    '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\>


    @zooba
    Copy link
    Member

    zooba commented Mar 14, 2019

    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.

    @zooba zooba added 3.8 only security fixes easy labels Mar 14, 2019
    @zooba zooba reopened this Mar 14, 2019
    @zooba zooba added the type-feature A feature request or enhancement label Mar 14, 2019
    @terryjreedy
    Copy link
    Member

    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

    @shireenrao
    Copy link
    Mannequin

    shireenrao mannequin commented Aug 8, 2019

    I just submitted a PR for this issue.

    @shireenrao
    Copy link
    Mannequin

    shireenrao mannequin commented Aug 13, 2019

    can a reviewer please take a look to my PR?

    @zooba
    Copy link
    Member

    zooba commented Aug 17, 2019

    New changeset 24fe460 by Steve Dower (shireenrao) in branch 'master':
    bpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180)
    24fe460

    @zooba
    Copy link
    Member

    zooba commented Aug 17, 2019

    Thanks for the contribution!

    @zooba zooba closed this as completed Aug 17, 2019
    @miss-islington
    Copy link
    Contributor

    New changeset 786a4e1 by Miss Islington (bot) in branch '3.8':
    bpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180)
    786a4e1

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes easy interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-windows type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants