in4lio / ev3dev-c

LEGO MINDSTORMS EV3 Debian C library + Python, Ruby and Perl wrappers
MIT License
71 stars 30 forks source link

Can ev3_link work on mac with python? #2

Closed dyhsiao closed 9 years ago

dyhsiao commented 9 years ago

I was trying to make remote ev3 running under my mac using python. However, when I try to run the setup.py or import ev3 it will give me this error:

Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6

if running pip install --pre ev3dev-c it will say:

setup.py", line 106, in NAME = import(PACKAGE).library File "ev3dev/init.py", line 1, in from ev3 import * File "ev3dev/ev3.py", line 28, in _ev3 = swig_import_helper() File "ev3dev/ev3.py", line 24, in swig_import_helper _mod = imp.load_module('_ev3', fp, pathname, description) ImportError: dlopen(ev3dev/_ev3.so, 2): no suitable image found. Did find: ev3dev/_ev3.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00

The readme didn't specify that it will work on mac but I just wonder if it is possible. Thanks.

in4lio commented 9 years ago

You can try to rebuild the package. First, you need to install SWIG and python-dev package. Second, specify the correct D_PYTHON and PYTHON_INCLUDE paths into ev3dev-c/python/makefile and run make. Finally, build the package: python setup.py sdist.