1

Thank you in advance for your kind support I installed the CPLEX academic version to solve a MIP model using Docplex in the VScode editor (using Python 3.10.4 64-bit). However, can't run it and getting the following error for this line: "from cplex import *":

Exception has occurred: ImportError
dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cplex/_internal/py310_cplex2210.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cplex/_internal/py310_cplex2210.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
  File "/Users/masoud/Desktop/Python-cplex/Pricing-h_g-w_pgijk-g2.py", line 8, in <module>

Can anyone advise me to handle this problem?

MattDMo
  • 100,794
  • 21
  • 241
  • 231

1 Answers1

0

The .so (library) file that Python is trying to open is built for macOS, but for x86_64 (Intel) hardware. You appear to be using a Mac with Apple's M1 architecture, which is incompatible with x86_64 machine code. You need to download the source of the cplex package, install XCode and the command-line tools, and re-build the library using the arm64e architecture, or as a "universal" binary.

Alternately, if the source is not available, check the vendor's website to see if they have any macOS "universal" builds available. If not, write to their tech support!

EDIT

I've done some research, and it does not appear that an M1 version is available from IBM. I would try to contact them or post in their community forum and push for an Apple Silicon port.

MattDMo
  • 100,794
  • 21
  • 241
  • 231