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

matplotlib: missing types #462

Closed
mvolkmann opened this issue Oct 6, 2020 · 5 comments
Closed

matplotlib: missing types #462

mvolkmann opened this issue Oct 6, 2020 · 5 comments
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs

Comments

@mvolkmann
Copy link

Do I understand correctly that Pylance bundles type stub files for popular libraries like matplotlib?
I get type errors for some things and I wonder if they are just missing from the bundled stub files.
For example, it doesn't recognize that Axes objects have a clear method and this import gives an error:

import matplotlib.animation as animation

Can I add my own versions of these stub files in the typings subdirectory of my project to override them?
If so, what file names do they need to have?

@github-actions github-actions bot added the triage label Oct 6, 2020
@jakebailey
Copy link
Member

jakebailey commented Oct 6, 2020

Yes, it does, and the matplotlib stubs aren't fully complete yet (at least for anything but autocompletion, our original reason for putting them there).

You can override them by adding typings/matplotlib, and the folder structure in there, or install a package that overrides them. The bundled stubs are read last overall (typings, installed stubs, original code).

@jakebailey jakebailey added the typestub Issue relating to our bundled type stubs label Oct 6, 2020
@jakebailey jakebailey self-assigned this Oct 6, 2020
@github-actions github-actions bot removed the triage label Oct 6, 2020
@mvolkmann
Copy link
Author

Oops! @jakebailey I guess you didn't want to close this yet. I reopened it.

@mvolkmann mvolkmann reopened this Oct 6, 2020
@jakebailey
Copy link
Member

Yes, I need to find some time to fix the matplotlib stubs.

@CatNofishing

This comment has been minimized.

@gramster gramster changed the title matplotlib types matplotlib: missing types Dec 18, 2020
@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Mar 3, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.3.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202130-3-march-2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs
Projects
None yet
Development

No branches or pull requests

3 participants