I installed CPlex version 22.1.1 - ARM64 for OSX and can run problems through the CPlex studio properly.
However, I can't get to make the python API work.
I am running a Macbook Pro with M1 chip (ARM64 achitecture).
The code I try to run:
Python 3.10.9 (v3.10.9:1dd9be6584, Dec 6 2022, 14:37:36) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cplex
The error I get
ImportError: dlopen(/Applications/CPLEX_Studio2211/cplex/python/3.10/arm64_osx/cplex/_internal/py310_cplex2211.so, 0x0002): tried: '/Applications/CPLEX_Studio2211/cplex/python/3.10/arm64_osx/cplex/_internal/py310_cplex2211.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/CPLEX_Studio2211/cplex/python/3.10/arm64_osx/cplex/_internal/py310_cplex2211.so' (no such file), '/Applications/CPLEX_Studio2211/cplex/python/3.10/arm64_osx/cplex/_internal/py310_cplex2211.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
The error suggests that python or the cplex python package requires x86_64 architecture, but only arm64 is available (which makes sense, since I installed the arm64 version of CPlex 22.1.1).
My PYTHONPATH points to the correct CPlex installation and I installed the python package using the setup.py script as per the instructions found
in the documentation here.
Is there a way to run the setup.py script in a way that is compatible with ARM64 arch? Or any other workaround to make the python API work?
Thanks!
------------------------------
Pierre Antoine Vaillancourt
------------------------------
#DecisionOptimization