Topic
1 reply Latest Post - ‏2013-06-25T15:34:03Z by rkersh
sedavidw
sedavidw
1 Post
ACCEPTED ANSWER

Pinned topic Python API for CPLEX not working on Mac OS X Lion

‏2013-05-11T07:08:10Z |

I have CPLEX 12.4 installed (I believe correctly) on my Mac OS X Lion.  I executed the .bin file and it seemed to work fine.  I then built and ran all the c++ examples and again everything seemed great.  However I want to use the Python API and went to build that.  Went to the Python path and executed:

python setup.py install

And this too seemingly worked fine

However when I run python and do

import cplex

I get the following error:

 

>>> import cplex
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cplex/__init__.py", line 43, in <module>
    import callbacks
  File "cplex/callbacks.py", line 48, in <module>
    from _internal._aux_functions import apply_freeform_two_args, apply_freeform_one_arg
  File "cplex/_internal/__init__.py", line 22, in <module>
    import _list_array_utils
  File "cplex/_internal/_list_array_utils.py", line 13, in <module>
    import _pycplex as CPX
  File "cplex/_internal/_pycplex.py", line 19, in <module>
    _pycplex_platform = swig_import_helper()
  File "cplex/_internal/_pycplex.py", line 15, in swig_import_helper
    _mod = imp.load_module('_pycplex_platform', fp, pathname, description)
  File "cplex/_internal/_pycplex_platform.py", line 23, in <module>
    from cplex._internal.py1013_cplex124 import *
ImportError: dlopen(cplex/_internal/py1013_cplex124.so, 2): no suitable image found.  Did find:
cplex/_internal/py1013_cplex124.so: mach-o, but wrong architecture

Based off googling it seems like there is some 64/32 bit architectures not matching up here.  I tried the solutions provided here: http://www-01.ibm.com/support/docview.wss?uid=swg21512309 with no avail.  Any help would be greatly appreciated

  • rkersh
    rkersh
    85 Posts
    ACCEPTED ANSWER

    Re: Python API for CPLEX not working on Mac OS X Lion

    ‏2013-06-25T15:34:03Z  in response to sedavidw

    With CPLEX 12.5.1 we have support for Xcode and 64-bit Python on Mac OS X.  Please see this announcement.