AttributeError: module 'pyautogui' has no attribute 'locateCentreOnScreen' - python

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.

Related

ModuleNotFoundError: No module named 'ecommerce'

I am new to python and I cannot get my head around why I am facing with the error in title.
This is my project structure:
and this is what I have inside shipping.py module:
def calc_shipping():
print('Calculating shipping...')
so when I do -> from ecommerce.shipping import calc_shipping
and want to use calc_shipping()
I get error ->
Traceback (most recent call last):
File "/Users/burakhanaksoy/gitHub/Python/PythonStudy/bman/basics/modules/app.py", line 9, in <module>
from ecommerce.shipping import calc_shipping
ModuleNotFoundError: No module named 'ecommerce'
any help is appreciated.
best,
PS: I get the same error in PyCharm as well, in fact in PyCharm, it doesn't even auto-fill 'ecommerce' or 'ecommerce.shipping' as I type
from ecommerce.shipping import calc_shipping
On such scenarios always check following things:
if the module has init, in other words if its a python module
check if its accessible from parent dir, in this example basics.

AttributeError: module 'seaborn' has no attribute 'heatmap'

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

ImportError: No module named kek.ccache

I really feel dumb asking this. but when am running MS14-068.py (https://github.com/bidord/pykek/blob/master/ms14-068.py) module in my kali with python version 2.7.13 i get the following error.
Traceback (most recent call last):
File "ms14-068.py", line 17, in <module>
from kek.ccache import CCache, get_tgt_cred, kdc_rep2ccache
ImportError: No module named kek.ccache
How do i fix this? I dont know much about pythonh. I googled it for that module but couldn't find a way. Any pointers would be great!
I had the same problem.
You need to install pykek, which is where ccache resides.
You can't run it if you don't have it. :)
https://github.com/bidord/pykek

Facebook-sdk python module has no attribute GraphAPI

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...

matplotlib xkcd not working

I am trying to get the matplotlib xkcd function working, following this after installing all the necessary stuff. http://matplotlib.org/xkcd/examples/showcase/xkcd.html
every time I get this:
Traceback (most recent call last):
File "graph.py", line 4, in <module>
plt.xkcd()
AttributeError: 'module' object has no attribute 'xkcd'
(I saved the code as graph.py)
Any ideas what could be going wrong?
The xkcd module was added in matplotlib 1.3.1. You need to update your version to that to get the xkcd examples to work properly.

Categories

Resources