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

ImportError: cannot import name 'normpdf' from 'matplotlib.mlab' #1657

Closed
Nokimann opened this issue Nov 11, 2019 · 1 comment
Closed

ImportError: cannot import name 'normpdf' from 'matplotlib.mlab' #1657

Nokimann opened this issue Nov 11, 2019 · 1 comment

Comments

@Nokimann
Copy link

Nokimann commented Nov 11, 2019

'normpdf' is deprecated? So it might result in ImportError.

Just when typed from matplotlib.mlab import normpdf
it shows ImportError
I was trying to use function 'save_spectre_plot' in 'pymatgen.io.gaussian.GaussianOutput'

I expect replacing 'normpdf' in 'matplotlib' with 'norm' in 'scipy' might solve this error.
Or, downgrading 'matplotlib' version

I refered,
https://stackoverflow.com/questions/12877794/whats-the-correct-usage-of-matplotlib-mlab-normpdf

@Nokimann
Copy link
Author

Nokimann commented Nov 11, 2019

I found the official notification.

Check 'matplotlib.mlab removals' in
https://matplotlib.org/3.1.0/api/api_changes.html

And definitely, replacing just two parts:

from matplotlib.mlab import normpdf -> from scipy.stats import norm
normpdf -> norm.pdf
(All is in the source of pymatgen.io.gaussian)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant