Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v0.1.20/py2.7] SyntaxError: 'return' with argument inside generator #46

Closed
jschueller opened this issue Mar 8, 2019 · 8 comments

Comments

@jschueller
Copy link
Contributor

commented Mar 8, 2019

Latest version 0.1.20 throws on import with python 2.7:

python -c 'import pyautogui'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "$PREFIX/lib/python2.7/site-packages/pyautogui/__init__.py", line 84, in <module>
    import pyscreeze
  File "$PREFIX/lib/python2.7/site-packages/pyscreeze/__init__.py", line 168
    yield Box(x, y, needleWidth, needleHeight)
SyntaxError: 'return' with argument inside generator
@bevar3

This comment has been minimized.

Copy link

commented Mar 14, 2019

Hi ,
I am a beginer in using PyAutoGui and it is failing in import pyautogui line itself. kindly assist.

Traceback (most recent call last):
File "C:\python scripts\autogui.py", line 1, in
from pyautogui import *
File "build\bdist.win-amd64\egg\pyautogui_init_.py", line 84, in
File "C:\Python27\lib\site-packages\pyscreeze-0.1.20-py2.7.egg\pyscreeze_init_.py", line 168
SyntaxError: 'return' with argument inside generator
[Finished in 0.4s]

@brenly

This comment has been minimized.

Copy link

commented Mar 15, 2019

i had this problem and using python 3 solved my problem. i strongly encourage you to migrate to python 3 and do not look back.

@thefeiter

This comment has been minimized.

Copy link

commented Apr 1, 2019

I am having the same problem on Ubuntu:

File "./test.py", line 7, in
import pyautogui
File "/home/user/.local/lib/python2.7/site-packages/pyautogui/init.py", line 84, in
import pyscreeze
File "/home/user/.local/lib/python2.7/site-packages/pyscreeze/init.py", line 168
yield Box(x, y, needleWidth, needleHeight)
SyntaxError: 'return' with argument inside generator

@bbrtan

This comment has been minimized.

Copy link

commented Apr 7, 2019

there are dependant library eg imagehorizon which is 2.7 hence there is a need to use this.

[ ERROR ] Error in file 'C:\Users\xxxx\auto_testing_pay\trunk\Test\Regression\01_FC324_NewHire.robot': Importing test library 'ImageHorizonLibrary' failed: SyntaxError: 'return' with argument inside generator (init.py, line 168)
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\ImageHorizonLibrary_init_.py", line 8, in
import pyautogui as ag
File "C:\Python27\Lib\site-packages\pyautogui_init_.py", line 65, in
import pyscreeze.

some cant move to python 3 yet. will try another version

@lixxu

This comment has been minimized.

@qhliang

This comment has been minimized.

Copy link

commented May 6, 2019

you can fix it like below, it works for me.
my pyscreeze version is 0.1.20, edit file pyscreeze/_ _ init _ _.py, replace "return None" with "return" in line 162 and line 261.

@lukaszgo1

This comment has been minimized.

Copy link

commented May 19, 2019

This one seems to be fixed. Can it be closed?

@jschueller

This comment has been minimized.

Copy link
Contributor Author

commented May 19, 2019

yup

@jschueller jschueller closed this May 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.