SyntaxError: 'return' with argument inside generator, when import pyautogui
See original GitHub issueThese modules are installed in my virtual environment:
Successfully installed Pillow-5.4.1 PyTweening-1.0.3 boto3-1.9.110 botocore-1.12.114 certifi-2019.3.9 chardet-3.0.4 comtypes-1.1.7 docutils-0.14 futures-3.2.0 idna-2.8 jmespath-0.9.4 numpy-1.16.2 pyautogui-0.9.41 pycryptodome-3.7.3 pygetwindow-0.0.4 pymsgbox-1.0.6 pyodbc-4.0.26 pypiwin32-223 pyrect-0.1.4 pyscreeze-0.1.20 python-dateutil-2.8.0 pythonnet-2.3.0 pywin32-224 pywinauto-0.6.6 requests-2.21.0 s3transfer-0.2.0 six-1.12.0 slacker-0.12.0 urllib3-1.24.1 wmi-1.4.9 xlrd-1.2.0
Then, when I try to import pyautogui
i got:
>>> import pyautogui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Adrian\Documents\GitHub\eagle-gold\scripts\python\env\lib\site-packages\pyautogui\__init__.py", line 84, in <module>
import pyscreeze
File "C:\Users\Adrian\Documents\GitHub\eagle-gold\scripts\python\env\lib\site-packages\pyscreeze\__init__.py", line 168
yield Box(x, y, needleWidth, needleHeight)
SyntaxError: 'return' with argument inside generator
Any recent changes introduce it?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Python SyntaxError: ("'return' with argument inside generator",)
is a generator. But I would return the value variable to the handler that called the function. It's this possible? How can I...
Read more >Issue 33555: No SyntaxError raised for `return` with argument ...
File "<stdin>", line 3 SyntaxError: 'return' with argument inside generator However, in python 3.6 the error is silently ignored Python ...
Read more >a return to yield - Python Does What?!?
SyntaxError : 'return' with argument inside generator. A rare compile-time error! Only the decorative, bare return is allowed in generators, ...
Read more >Cheat Sheet - PyAutoGUI documentation - Read the Docs
This is a quickstart reference to using PyAutoGUI. PyAutoGUI is cross-platform GUI automation module that works on Python 2 & 3. You can...
Read more >Python: SyntaxError 'return' outside function error
Your docstring is indented further than the if conditional. docstrings are Python objects and as such are part of the code. Make sure...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, sorry to do not mentioned that I’m using Python 2. Now I’m using
pyautogui-0.9.41
andpyscreeze-0.1.19
and seems to work. Lesson learned: do not rely on the latest version since is not always better then previous one 😄I have the same problem, this didn’t solve it.