Skip to content

use('module://') directive doesn't work as expected #2309

Closed

Description

@andreabedini
import matplotlib
matplotlib.use('module://my_backend')

doesn't work as expected if my_backend's name clashes with one of the modules in matplotlib.backends. In that case the result is confusing (in my case my_backend is called backend_webagg since I was experimenting on it).

  • get_backend() still says module://my_backend
  • pylab_setup() returns the module with the same name from matplotlib.backends

I would expect pylab_setup() to return the same module as import my_backend.

Activity

  1. WeatherGod commented on Aug 22, 2013

    @WeatherGod
    Member

    Technically, it is. It is importing backend_webagg from where it is. It is
    a completely different place than where your code that called
    use('module://backend_webagg'). Now, one thing I haven't thought about is
    differences in behavior between py2.x and py3k for this feature. This
    particular feature probably doesn't get exercise in our test suite, so I am
    not sure how it should behave.

  2. andreabedini commented on Aug 23, 2013

    @andreabedini
    Author

    I understand what's happening and why the module in matplotlib.backends gets picked. Perhaps we should make sure the import is always absolute.

  3. added a commit that references this issue on Aug 23, 2013
    5f14f6f
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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions