I am fairly new to Python. I am trying to run the below code and getting Module not found error. I tried checking seaborn version and it was the latest. After multiple tries I placed my file in a different path and it started working fine. Could someone help me understand this behavior.
My Anaconda path: C:\Users\Kumar>
Placed the file in same path and it did not run.
Placed the file in Downloads and ran again from Jupyter and it worked fine. Please help in understanding what is the difference and how can I resolve these errors in future
My Code:
corr = df.corr()
plt.figure(figsize=(14,14))
plt.figure(figsize=(14,14))
sns.heatmap(corr,cmap= 'coolwarm')
AttributeError Traceback (most recent call last)
<ipython-input-15-522f105baca0> in <module>
2 plt.figure(figsize=(14,14))
3 plt.figure(figsize=(14,14))
----> 4 sns.heatmap(corr,cmap= 'coolwarm')
AttributeError: module 'seaborn' has no attribute 'heatmap'
possibly you need to install additional modules:
statsmodels
fastcluster
It works for me
see https://seaborn.pydata.org/installing.html
Related
I have PyAutoGUI-0.9.52 and there no file in the working directory named pyautogui. I have pillow installed, but still, it shows this error please can someone help me.
This is the full error:
Traceback (most recent call last):
File "C:\Users\Admin\Desktop\lolllll.py", line 4, in <module>
pyautogui.click(pyautogui.locateCentreOnScreen('launcher.png'))
AttributeError: module 'pyautogui' has no attribute 'locateCentreOnScreen'
If there is no solution please suggest a different module which can do this. But I would prefer to stick with this.
We can't help you without code. However, a simple google search results in the fact that you mistyped, and the function is pyautogui.locateCenterOnScreen(...), with a properly spelled center.
I am trying to run this program https://github.com/catthatcodes/car-damage-assessment
and currently, i am getting this error.
Traceback (most recent call last):
File "/Users/vikrant/Downloads/Car/catthatcodes/app/app.py", line 7, in module
from pipeline import pipeline
graph = tf.get_default_graph()
AttributeError: module 'tensorflow' has no attribute 'get_default_graph'
You should try changing your imports from keras to tensorflow.keras, as it seems like a Tensorflow version update caused the change.
Alternatively, you may downgrade your Tensorflow version to a one that is compatible with your current way of calling it.
The issue is detailed here: https://github.com/keras-team/keras/issues/12783
I want to use the signal processing library under Scipy. But running the following example code given in Scipy webpage has given me an error. I have rechecked my Scipy installation and it is the latest.
The example code I ran is as follows
from scipy import signal
import numpy as nu
b=nu.array([0.5,0.25])
a=nu.array([1.0,-1.0/3])
C=nu.array([[0,1]])
D=nu.array([[0]])
num=[1,3,3]
den=[1,2,1]
sys=signal.TransferFunction(num,den)
print sys
When I ran it, it gives:
$ python trial.py
Traceback (most recent call last):
File "trial.py", line 9, in <module>
sys=signal.TransferFunction(num,den)
AttributeError: 'module' object has no attribute 'TransferFunction'
AttributeError: 'module' object has no attribute 'TransferFunction'
This is the key phrase you want to search based on. Have you tried importing the module explicitly?
Also this could give you more information related to your problem.
Please check the scipy version you have installed, if you have an older version of scipy the TransferFunction might not be there, due to which you are seeing the AttributeError
For me your code worked fine for latest version of scipy
I am following the installation process stated here. I am stuck on step 7; I get an ImportError stating:
"RuntimeError: module compiled against API version 9 but this version of numpy is 7
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import cv2
ImportError: numpy.core.multiarray failed to import"
In the instructions it recommends me to install the latest version of opencv, so as trial and error i tried an earlier model to see what would happen...i get the same thing -_-.
Could anyone point to me what I'm doing wrong, if there are no feasible solutions, is there a more stable process of doing this
Thanks in advance.
Someone experienced a similar error here. Make sure your numpy is up to date and don't forget to change the path to the new bin directory in your environment variable.
After installing the facebook-sdk module here, and looking at other solutions here and elsewhere, I keep getting this error:
Traceback (most recent call last):
File "facebook.py", line 1, in <module>
import facebook
File "/home/facebook/facebook.py", line 3, in <module>
graph = facebook.GraphAPI(access_token='ACCESS TOKEN HERE')
AttributeError: 'module' object has no attribute 'GraphAPI'
For this very simple python code to authenticate...
import facebook
graph = facebook.GraphAPI(access_token='ACCESS TOKEN HERE')
print 'Workinnnn'
It says my module is installed and up to date, and I have installed both within (as suggested) a virtualenv and outside, and still get the error. I also definitely HAVE the module in usr/local/lib/python etc. dist packages... and it contains the class GraphAPI
Has anyone got a suggestion either:
1) What might be going wrong?
2) What to try to fix it? UNinstall something?
3) If there is another way other than pip to install the module... I don't normally use pip (but definitely have it installed and installed facebook-sdk from it) so if there's another way then I'd like to try...
Cheers :/
Solution = don't name your script the same as your module.
I'm an idiot, sigh...