Installing on a Mac M1

1,602 views
Skip to first unread message

Ani Banerjee

unread,
Jun 17, 2021, 1:15:46 AM6/17/21
to Python-MIP
I have installed Cbc on my Mac m1, via. brew, the installation location being /opt/homebrew. The stand-alone solver works fine.

Following this, I have set the following options:
export PMIP_CBC_LIBRARY="/opt/homebrew/lib/libCbcSolver.dylib"
export LD_LIBRARY_PATH="/opt/homebrew/lib/":$LD_LIBRARY_PATH

However, I still have an error when I access the MIP library -

AttributeError: function/symbol 'Osi_getIntegerTolerance' not found in library '/opt/homebrew/lib/libCbcSolver.dylib': dlsym(0x10bd38000, Osi_getIntegerTolerance): symbol not found

Any help would be appreciated, thanks!

Feibiao Wu

unread,
Oct 15, 2022, 7:51:16 AM10/15/22
to Python-MIP
Hello!

I have encountered the same issue. Can I ask if you've solved this problem? If so, how?

Anindya Banerjee

unread,
Oct 16, 2022, 2:26:59 PM10/16/22
to Python-MIP
I never solved it, and moved away from this library as a result.

Túlio Toffolo

unread,
Oct 18, 2022, 12:33:48 AM10/18/22
to Anindya Banerjee, Python-MIP
We unfortunately do not have a Mac M1 to test at the moment.
Hopefully we'll be able to address this in the near future.

--
You received this message because you are subscribed to the Google Groups "Python-MIP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-mip+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-mip/ea62c06a-7af4-4df4-b9c0-ec92457350efn%40googlegroups.com.

Penelope Aguiar

unread,
Feb 14, 2023, 4:35:14 AM2/14/23
to Python-MIP
Hi! I have the same issue.
Tried also building the cbc solver with coinbrew which produced files with .a at the end instead of .dylib.
When I tried to point to libCbcSolver.a it didn't manage to open it :/

Tom Shlomo

unread,
Mar 5, 2023, 3:52:38 AM3/5/23
to Python-MIP
Hi, we have the same issue. Are there any plans to add M1 support? Thanks!

Julio Villalobos

unread,
Mar 8, 2023, 10:31:40 AM3/8/23
to Python-MIP
same, any solution?

Amitai Zernik

unread,
Mar 20, 2023, 6:17:59 AM3/20/23
to Python-MIP
+1

Tom Shlomo

unread,
Apr 19, 2023, 4:32:48 AM4/19/23
to Python-MIP
a temp solution is to compile CBC from source:
```
mkdir CBC
cd CBC
chmod u+x coinbrew 
./coinbrew fetch Cbc@master
./coinbrew build Cbc 
cp dist/lib/libCbc.0.dylib ~/.pyenv/versions/3.9.16/lib/python3.9/site-packages/mip/libraries/cbc-c-darwin-x86-64.dylib
```
replace `~/.pyenv/versions/3.9.16/lib/python3.9/site-packages/mip` with your own python-mip location.

hope that helps

Walcelio Melo

unread,
May 19, 2023, 9:21:37 AM5/19/23
to Python-MIP
I tried installing CBC via conda, then Homebrew, and setting the required environment variables: but it did not work.
The only solution that worked so far is the one provided by Tom... thank you!

Sean Kelley

unread,
Jul 3, 2023, 5:15:25 PM7/3/23
to Python-MIP
I "fixed" this issue by just having conda build the x86 version, so then you don't have to worry about building CBC yourself.

```
CONDA_SUBDIR=osx-64 conda create -n myenv python
pip install mip
```
Message has been deleted

Tyrael Fu

unread,
Mar 1, 2024, 10:04:32 AM3/1/24
to Python-MIP
The solution provided by Tom works at 2024. Thank you!

Tom Shlomo 在 2023年4月19日 星期三下午4:32:48 [UTC+8] 的信中寫道:

Python-MIP

unread,
Mar 1, 2024, 10:34:47 AM3/1/24
to Python-MIP
Hi,

The latest 'release candidate' version of Python-MIP (1.16RC0) includes CBC binaries for Apple ARM64 (M1/M2/M3) processors.
You can install it via pip: pip install mip==1.16rc0

yossi amgar

unread,
Aug 14, 2024, 5:34:38 AM8/14/24
to Python-MIP
Hi,
I am definitely not an expert like you guys, 
but for me running Mac Ultra M2 on Mac OS 14.3.1, this process worked:

1. Revert to Python 3.10 (otherwise I get cffi error when I run the code)

2. Install CBC solver via conda, i.e. type in terminal: conda install coin-or-cbc
like explained in: https://github.com/coin-or/Cbc/tree/master
(so for me no need to build from source)

3. Install mip by typing in terminal: pip install mip

4. Use the solution of "Tom Shlomo", i.e. in terminal type something like:
cp ~/dist/lib/libCbc.0.dylib ~/.pyenv/versions/.../site-packages/mip/libraries/cbc-c-darwin-x86-64.dylib
of course with appropriate adjustments, to the location of your Python environment as Tom explained.

5. Run the code and hopefully it will work 
Reply all
Reply to author
Forward
0 new messages