Skip to content

Give more explicit ImportErrors #261

Closed

Description

@filmor

Currently, an ImportError raised from Python.NET does not include information on the actual dependency that failed to load.

Activity

  1. den-run-ai commented on Sep 7, 2016

    @den-run-ai
    Contributor

    related? #111

  2. filmor commented on Sep 7, 2016

    @filmor
    MemberAuthor

    Could be. I just recognised this today as a problem, when I (again) had to do an clr.AddReference ... .GetDependentAssemblies-dance to find out which library could not be loaded.

  3. den-run-ai commented on Sep 7, 2016

    @den-run-ai
    Contributor

    @filmor the problem is that some third-party packages try to import some libraries and have backup logic if no success. So how would we distinguish between package -handled and -unhandled imports?

  4. filmor commented on Sep 7, 2016

    @filmor
    MemberAuthor

    We should still raise an import error, we should just add information to the message, which assembly could not be loaded and why, basically the information that the.NET exception contains.

  5. den-run-ai commented on Sep 7, 2016

    @den-run-ai
    Contributor

    what I meant is actually cases like this and we would bug down the user with optional imports failing:

    https://github.com/pydata/pandas/blob/master/pandas/computation/__init__.py

  6. filmor commented on Sep 7, 2016

    @filmor
    MemberAuthor

    That's not what I'm saying, I'm suggesting keeping the ImportError and just extending the information it carries, i.e. you get ImportError: No module named 'bla', tried to import bla.dll but failed loading the dependency blubb.dll because of reasons.

  7. den-run-ai commented on Sep 20, 2016

    @den-run-ai
    Contributor

    @filmor agreed! we need to extend the passed information.

  8. added 2 commits that reference this issue on Dec 1, 2016
  9. added this to the 2.3.0 milestone on Feb 2, 2017
  10. added 4 commits that reference this issue on Feb 22, 2017
  11. 3 remaining items

  12. modified the milestones: 2.4.0, 2.5.0 on Apr 12, 2019
  13. lostmsu commented on Apr 27, 2020

    @lostmsu
    Member

    @filmor the right way to do it is to enable Fusion Log on Windows or set Mono debug environment variables for Mono.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions