99designs / colorific

Automatic color palette detection
ISC License
700 stars 55 forks source link

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

Closed petarov closed 12 years ago

petarov commented 12 years ago

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 commented 12 years ago

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 commented 12 years ago

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 commented 12 years ago

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!

dhotson commented 12 years ago

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

gkmngrgn commented 6 years ago

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

gabycperezdias commented 6 years ago

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 commented 6 years ago

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

AlexWUrobot commented 1 year ago

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