2

So I'm trying to install SimpleCV on my Mac which is running OS X 10.10.3 (Yosemite). I have python 3.4.3 installed and pygame is also installed (which I apparently need for SimpleCV). I have installed SimpleCV by running

    sudo pip3 install SimpleCV

and it downloaded and installed SimpleCV-1.3.tar.gz. Then when I try running it in python this is what I get:

$ python3
Python 3.4.3 (default, Jun 10 2015, 19:56:14) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import SimpleCV
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/site-packages/SimpleCV/__init__.py", line 3, in <module>
    from SimpleCV.base import *
  File "/usr/local/lib/python3.4/site-packages/SimpleCV/base.py", line 139
    print 'unit test'
                ^
SyntaxError: Missing parentheses in call to 'print'
>>> 
Adam
  • 21
  • 1
  • 3
  • 1
    Obviosly, this package was made for python 2.x (since python 3, the `print` statement is a function and must be used with paranthesis, so `print('unit test')` would be correct.) Either rewrite the code in the file it gives you, or run it with `python2`. – Maximilian Gerhardt Sep 22 '15 at 22:43
  • Ok I tried running on python2, but I needed to install pygame for that version. I followed the instructions here: [link](http://stackoverflow.com/questions/20968480/installing-pygame-module-for-python-2-7-5-on-terminal) I ran python and tried to import pygame but I got something like this: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so, 2): no suitable image found. – Adam Sep 23 '15 at 02:36
  • sorry never mind, had to use the 32 bit version – Adam Sep 23 '15 at 02:39

2 Answers2

0

SimpleCV is only compatible with python 2.x and pygame and OpenCV installed along with it. This is a problem because python 2.x will soon be phased out.

I would suggest trying to run your code in python 2.x environment.

if you are trying to create it in an anaconda distribution then create a new environment by the following code:

conda create --name py27 python=2.7

and then you would also be needing pygame and opencv along with it which can be installed in that py27 environment

so go in that environment by

conda activate py27

and then install pygame and opencv

conda install -c cogsci pygame
conda install -c menpo opencv

and then you can try running your code, and the unit test error should disappear.

And if you're not using anaconda distribution then just installed the necessary libraries which are python 2.x with pygame and OpenCV installed.

-3

im also have been through the same problem before but you can try this

print(unit test)

hope its works!!