-
Notifications
You must be signed in to change notification settings - Fork 130
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
Not able to run crop_morphology.py #107
Comments
Sounds like a Python 2/3 issue. |
I may be having a similar issue. First, PIL seems to have been replaced by Pillow, so I changed that import on line 24 to indicate Pillow instead. Since that was in python 3 on my system, I changed the first line to
Now I get the error:
My python skills are minimal, so I don't immediately see what's wrong with that print statement. Or maybe it's something else? |
Try using 2to3 to convert the script from Python 2 to 3 (worked for me when getting the same error). To make the changes persistent:
|
It is a python 2 -> 3 issue. The solution is considering how to access the values inside the tuple object borders: # https://www.python.org/dev/peps/pep-3113/
borders.sort(key=lambda x: (x[3] - x[1]) * (x[4] - x[2])) |
That user doesn't seem to be on GitHub anymore. Maybe this? |
I get an error while compiling crop_morphology.py . It also shows undefined error with the print statements.
It also shows an error in the following line:
borders.sort(key=lambda (i, x1, y1, x2, y2): (x2 - x1) * (y2 - y1))
Can anyone help me in running this file successfully ?
The text was updated successfully, but these errors were encountered: