• 1 reply
  • Latest Post - ‏2013-06-25T15:34:03Z by rkersh
1 Post

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 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/", line 43, in <module>
    import callbacks
  File "cplex/", line 48, in <module>
    from _internal._aux_functions import apply_freeform_two_args, apply_freeform_one_arg
  File "cplex/_internal/", line 22, in <module>
    import _list_array_utils
  File "cplex/_internal/", line 13, in <module>
    import _pycplex as CPX
  File "cplex/_internal/", line 19, in <module>
    _pycplex_platform = swig_import_helper()
  File "cplex/_internal/", line 15, in swig_import_helper
    _mod = imp.load_module('_pycplex_platform', fp, pathname, description)
  File "cplex/_internal/", line 23, in <module>
    from cplex._internal.py1013_cplex124 import *
ImportError: dlopen(cplex/_internal/, 2): no suitable image found.  Did find:
cplex/_internal/ 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: with no avail.  Any help would be greatly appreciated

  • rkersh
    151 Posts

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


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