Seaborn module 'histplot' not found

Viewed 3073

I am running seaborn on pycharm. However when I'm running the histplot module, it says there are no module in that name. However, the seaborn version is the latest (0.11.0) and the python version I'm using is 3.6.2. Where is the error?

2 Answers

I tried to reproduce the error with seaborn version 0.10.0and 0.11.0. I believe you are not using 0.11.0 as the histplot is a method under the documentation of version 0.11.0. Check the version using:

import seaborn as sns
print(sns.__version__)

Code from @StupidWolf produces the following results with 0.11.0. :

enter image description here

I could reproduce the error in 0.10.0. Therefore, I would suggest to reinstall/upgrade seaborn with the following:

pip install seaborn==0.11.0  

histplot is a function under seaborn, so if you do:

import histplot
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-3-fc88c9bf8fe2> in <module>
----> 1 import histplot

ModuleNotFoundError: No module named 'histplot'

You need to do:

import seaborn as sns
data = sns.load_dataset("iris")
sns.histplot(data['sepal_length'])
Related