Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

except Exception, e: / SyntaxError: invalid syntax #5

Closed
petarov opened this issue May 12, 2012 · 8 comments
Closed

except Exception, e: / SyntaxError: invalid syntax #5

petarov opened this issue May 12, 2012 · 8 comments

Comments

@petarov
Copy link

petarov commented May 12, 2012

Hi,

While trying to test some sample images, I got this far:

$ echo j_e6a6aca6.png | python colorific.py 
File "colorific.py", line 48
  except Exception, e:
                  ^
 SyntaxError: invalid syntax

Could it be something with the python version I got here ? My system params:

Linux Arch 3.3.5
Python 3.2.3
python-imaging 1.1.7-4
python-colormath-git 20120512-1
python2-numpy 1.6.1-1

Thanks

@dhotson
Copy link
Contributor

dhotson commented May 12, 2012

Ah, we haven't got it working on Python 3 yet sorry. I have a feeling that might be the problem. We've tested it on Python 2.7.

@petarov
Copy link
Author

petarov commented May 12, 2012

Thanks Dennis, that seems to be it. I did some small changes to the .py file as shown here:

http://docs.python.org/release/3.0.1/whatsnew/2.6.html#pep-3110
http://docs.python.org/release/3.0.1/whatsnew/3.0.html
(mostly some brackets need be added)

but now I get:

$ ./colorific.py 
Traceback (most recent call last):
File "./colorific.py", line 19, in <module>
    import Image as Im
ImportError: No module named Image

I do have the python-imaging installed, but I'm not sure why it still fails. Will do some more digging.

@petarov
Copy link
Author

petarov commented May 12, 2012

Ok, as stated on http://www.pythonware.com/products/pil/, PIL does not support Python 3, yet ;)

Therefore for Arch users

Make sure you got these installed:

$ pacman -Q | grep python
python-imaging 1.1.7-4
python-numpy 1.6.1-1
python-colormath-git 20120512-1

(I installed colormath via yaourt).

Then simply use the available py2.7, e.g.,

$ echo j_e6a6aca6.png | python2 colorific.py

Works like charm!

@petarov petarov closed this as completed May 12, 2012
@dhotson
Copy link
Contributor

dhotson commented May 13, 2012

Thanks for digging in Petrov. Hopefully PIL has Python 3 support in the works soon-ish.. :-)

@gkmngrgn
Copy link
Contributor

gkmngrgn commented Jun 5, 2018

@gabycperezdias colorific seems to support python version 3. Do you mean MplayerCtrl? Is colorific dependency of MplayerCtrl?

@gabycperezdias
Copy link

Hi @gkmngrgn SO sorry... I was searching for the MplayerCtrl, and I didn't realize that this was not about it... that's why I removed the post... I thought it was in time for you not to receive the message. SO sorry again.

@gkmngrgn
Copy link
Contributor

gkmngrgn commented Jun 6, 2018

@gabycperezdias no problem, please contact me directly if you still need any help. 👍

@AlexWUrobot
Copy link

I solve this problem by using python 2.7, instead of python 3.
You can simply add 2.7 on your first line
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants