Swig import file with wrong architecture: PyFLTK error

160 views Asked by At

Sorry if this is a dumb question, but I'm trying to get PyFLTK working on my mac. It's worked for other people, and I managed to get it compiled, but when I try to use it, this happens:

$ python example.py
Traceback (most recent call last):
  File “example.py", line 2, in <module>
    from fltk import *
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fltk/__init__.py", line 33, in <module>
    _fltk = swig_import_helper()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fltk/__init__.py", line 29, in swig_import_helper
    _mod = imp.load_module('_fltk', fp, pathname, description)
ImportError: dlopen(/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fltk/_fltk.so, 2): no suitable image found.  Did find:
    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fltk/_fltk.so: mach-o, but wrong architecture
$ file /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fltk/_fltk.so
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fltk/_fltk.so: Mach-O bundle i386

I've seen some other posts recommending different ways to compile the file in question, _fltk.so, but the problem is that I didn't compile this myself, SWIG did. I've been looking in fltk_wrap.cpp, but I really don't know anything about SWIG, or C++ for that matter. I don't think there's anything relevant in setup.py either.

If anyone has any clue, whether or not you know how to use FLTK or SWIG, as to how I can get this to work, I'll be very appreciative!

0

There are 0 answers