sightmachine/SimpleCV

Python 3 support

Closed this issue · 6 comments

When I try to install SimpleCV in Python 3, it shows errors that would indicate some old, Python 2 style code.

Trace:

$ sudo pip3 install SimpleCV
Downloading/unpacking SimpleCV
  Downloading SimpleCV-1.3.tar.gz (213kB): 213kB downloaded
  Running setup.py egg_info for package SimpleCV

Installing collected packages: SimpleCV
  Running setup.py install for SimpleCV
      File "/usr/local/lib/python3.3/site-packages/SimpleCV/base.py", line 139
        print 'unit test'
                        ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Camera.py", line 363
        print "coord: (" + str(d.mouseX) + "," + str(d.mouseY) + "), color: " + str(i.getPixel(d.mouseX,d.mouseY))
                       ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Color.py", line 213
        print a
              ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/DrawingLayer.py", line 40
        def __init__(self, (width, height)):
                           ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/EXIF.py", line 1182
        y = 0L
             ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Features/Blob.py", line 876
        print self.mHullMask
                 ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Features/BlobMaker.py", line 97
        except RuntimeError,e:
                           ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Features/BOFFeatureExtractor.py", line 68
        print "Opening file: " + infile
                             ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Font.py", line 68
        print "Please pass a string"
                                   ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/ImageClass.py", line 132
        print "You need to install Beatutiul Soup to use this function"
                                                                      ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/MachineLearning/KNNClassifier.py", line 153
        print "Opening file: " + infile
                             ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/MachineLearning/NaiveBayesClassifier.py", line 120
        print "Opening file: " + infile
                             ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/MachineLearning/SVMClassifier.py", line 181
        print "Opening file: " + infile
                             ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/MachineLearning/TreeClassifier.py", line 190
        print "Opening file: " + infile
                             ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Shell/Example.py", line 28
        print "Available Examples:"
                                  ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Shell/Shell.py", line 71
        print "args", arg
                   ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Shell/Tutorial.py", line 35
        print lb
               ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/Stream.py", line 62
        except socket.error, e:
                           ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/tests/test_cameras.py", line 17
        print str(i) + ": " + str(props[i]) + "\n"
                ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/tests/test_display.py", line 80
        print val
                ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/tests/test_optional.py", line 91
        print foundtext
                      ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/tests/test_stereovision.py", line 54
        print val
                ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/tests/tests.py", line 74
        print val
                ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/tests/vcamera_tests.py", line 19
        print str(i) + ": " + str(props[i]) + "\n"
                ^
    SyntaxError: invalid syntax

      File "/usr/local/lib/python3.3/site-packages/SimpleCV/tests/YCrCbtests.py", line 6
        print "Converted to YCrCb\n"
                                   ^
    SyntaxError: invalid syntax


    Installing simplecv script to /usr/local/bin
Successfully installed SimpleCV
Cleaning up...

System:

$ specs python3 brew os
Specs:

specs 0.7
https://github.com/mcandre/specs#readme

pip3 --version
pip 1.4.1 from /usr/local/lib/python3.3/site-packages/pip-1.4.1-py3.3.egg (python 3.3)

python3 --version
Python 3.3.2

brew --version
0.9.5

system_profiler SPSoftwareDataType | grep 'System Version'
      System Version: OS X 10.9 (13A603)

This is correct, SimpleCV does not work under python 3 yet. Many of the underlying libraries are slowly making the move, but until that happens we can not.

got that. who notifies/responds to our community?

On Tue, Nov 26, 2013 at 7:09 AM, Anthony Oliver notifications@github.comwrote:

This is correct, SimpleCV does not work under python 3 yet. Many of the
underlying libraries are slowly making the move, but until that happens we
can not.


Reply to this email directly or view it on GitHubhttps://github.com//issues/594#issuecomment-29299471
.

I successfully install the SimpleCV, but it shows that it needs py2.x.

I using following code which from SimpleCV homepage example.

from SimpleCV import Camera
# Initialize the camera
cam = Camera()
# Loop to continuously get images
while True:
    # Get Image from camera
    img = cam.getImage()
    # Make image black and white
    img = img.binarize()
    # Draw the text "Hello World" on image
    img.drawText("Hello World!")
    # Show the image
    img.show()
Traceback (most recent call last):
  File "c:\Users\Zero\Documents\Untitled-1.py", line 1, in <module>
    from SimpleCV import Camera
  File "C:\Software\Miniconda3\lib\site-packages\SimpleCV\__init__.py", line 3, in <module>
    from SimpleCV.base import *
  File "C:\Software\Miniconda3\lib\site-packages\SimpleCV\base.py", line 139
    print 'unit test'
                    ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('unit test')?

same problem , 👎

they should support python 3 though python 2 will be phased soon

C'mon We need python3 version of this! Otherwise I (and a lot of people like me) have to create another app with python2 and try to control it with my python3 app (maybe even through socket), which is too frustrating!

I successfully install the SimpleCV, but it shows that it needs py2.x.

I using following code which from SimpleCV homepage example.

from SimpleCV import Camera
# Initialize the camera
cam = Camera()
# Loop to continuously get images
while True:
    # Get Image from camera
    img = cam.getImage()
    # Make image black and white
    img = img.binarize()
    # Draw the text "Hello World" on image
    img.drawText("Hello World!")
    # Show the image
    img.show()
Traceback (most recent call last):
  File "c:\Users\Zero\Documents\Untitled-1.py", line 1, in <module>
    from SimpleCV import Camera
  File "C:\Software\Miniconda3\lib\site-packages\SimpleCV\__init__.py", line 3, in <module>
    from SimpleCV.base import *
  File "C:\Software\Miniconda3\lib\site-packages\SimpleCV\base.py", line 139
    print 'unit test'
                    ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('unit test')?

Hi, I'm trying to migrate the SimpleCV Library from Python 2.X to Python 3.X, I'm having this problem "File "/home/pi/Code/SimpleCV/SimpleCV/EXIF.py", line 1182
y = 0L".

If you want we can collaborate to migrate SimpleCV. Write me to my Telegram: jairoareyes