AttributeError: module 'seaborn' has no attribute 'heatmap' in Spyder - python

I downloaded the seaborn module and I am unable to use the heatmap function in Spyder (latest version), please help!
I also tried installing:
statsmodels
fastcluster
And also tried downgrading matplotlib but didn't work
import seaborn
seaborn.heatmap(Data_Set7)
Error:
File "<ipython-input-13-0336b4e3860e>", line 1, in <module>
seaborn.heatmap(Data_Set7)
AttributeError: module 'seaborn' has no attribute 'heatmap'

Related

Numpy issue module 'os' has no attribute 'add_dll_directory'

When importing Numpy Keras Tensorflow I recieve this error
File "c:/Users//AppData/Local/Programs/Python/Python36/lib/site-packages/numpy/__config__.py", line 12, in <module> os.add_dll_directory(extra_dll_dir) AttributeError: module 'os' has no attribute 'add_dll_directory'
I have tried uninstalling and re installing numpy keras and tensorflow but this issue still remains, please help.
I have tried running this in other environments such as Replit but it still doesnt work.

Cannot import opencv because of circular import

When trying to import opencv in jupyter lab notebook (import cv2) i get this error:
AttributeError: partially initialized module 'cv2' has no attribute
'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular
import)
I have tried installing opencv both via pip:
pip install opencv-python
than via conda-forge:
conda install -c conda-forge opencv
in different envs, also uninstalling and reinstalling.
If i try to import it via command line python i do not get any error.
I came up with a dirty fix, for the ones that are in a rush.
The error is produced by the last line (290) of the file: /.local/lib/python3.8/site-packages/cv2/gapi/__init__.py:
cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline
That seems like some sort of naming adjustment. I commented out the line and the import error is gone and the library seems to work ok.

Matplotlib ModuleNotFoundError: No module named 'mpl_toolkits.basemap'

I was trying to create a plot of a map with matplotlib, and I tried to run this code:
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
map = Basemap()
plt.show()
but I get this error:
ModuleNotFoundError: No module named 'mpl_toolkits.basemap'
I have read many answers to similar problems, but none of them have worked for me.
(Python basemap module impossible to import, ModuleNotFoundError: No module named 'mpl_toolkits.basemap')
I am running Python 3.7 on macOS 10.15.5 using PyCharm

AttributeError: module 'dateutil.parser' has no attribute 'parse' pandas on python 3.7

I tried install pandas via command pip install pandas and got error:
import pandas
../python3.7/site-packages/pandas/compat/__init__.py", line 440, in <module>
parse_date = _date_parser.parse
AttributeError: module 'dateutil.parser' has no attribute 'parse'
pip install python-dateutil==2.5.*
and then install pandas. It solves that problem.

Python: AttributeError: 'module' object has no attribute 'AddReference'?

Am trying to use clr.AddReference and clr.AddReferenceToFile to import an assembly, but python(2.7) keeps making this error:
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
clr.AddReference("UnityEngine")
AttributeError: 'module' object has no attribute 'AddReference'
Can anyone tell me how to fix this.
Once I met this issue.
There is a package named clr while the pythonnet package's alias is also clr.
So I removed clr by "pip uninstall clr" and then installed pythonnet by 'pip install pythonnet'.
Finally, everything works well.
You must be using the wrong 'clr' module.
remove it
pip uninstall clr
And then install pythonnet
pip install pythonnet
run the code
import clr
dir(clr)
if the reasult is as ['StyleBuilder', 'builtins', 'cached',....]
then the problem is your IDE is installing the WRONG Clr module

Categories