简体   繁体   中英

Error in Ortools installation (x86) - mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64h')

I am recieving this error when installing and running

from ortools.constraint_solver import pywrapcp

after following this guide. https://developers.google.com/optimization/install/python/mac

I am using a 2019 MacBook Pro (V 12.4, Python 3.9.4), which is x86, and not M1. However, the error is regarding the module not being compatible with M1 Macs, which should not apply. All information available online is about the error regarding M1 Macs. Any help is appreciated!

ImportError: dlopen([path], 0x0002): tried: '[path]/my_env/lib/python3.9/site-packages/ortools/linear_solver/_pywraplp.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64h'))

M1 only wheel package have been named universal2 by pypa tools so any intel based mac currently pull it -> runtime issue.

On my way to fix our upload and release script, sorry for the inconvenience...

note: issue tracked in https://github.com/google/or-tools/issues/3436
note2: one workaround would be to download "locally" the correct wheel package then install it cd <you_download_dir>; python -m pip install --find-links=. ortools cd <you_download_dir>; python -m pip install --find-links=. ortools

try forcing the arch to x64_64.

For some reason, brew python tags aarch64 wheel as universal, and x86_64 as x86_64.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM