NeuralNetworkVerification/Marabou

"cannot find reference 'MarabouCore' in '__init__.py'" after cmake MacOS12.5 python>3.8

INPUTrrr0 opened this issue · 7 comments

I am unable to install marabou on my current machine. I am able to go through the commands up until "cmake --build ." where I meet the following error:
1791708139337_ pic copy

I am using cmake version 3.28.3 on Apple M1 Pro MacOS 12.5.1.

Attempt of using "pip install maraboupy" results in "ERROR: Could not find a version that satisfies the requirement maraboupy (from versions: none)
ERROR: No matching distribution found for maraboupy".

Attempt to build from wheel results in: "ERROR: maraboupy-1.0.0-cp39-cp39-macosx_13_0_arm64.whl is not a supported wheel on this platform."

I've tried both python3.9 and python3.11.

Update: doing pip install in a new conda environment seems to work: "Requirement already satisfied: maraboupy in /opt/anaconda3/envs/nap/lib/python3.11/site-packages (1.0.0)" but >>> from maraboupy import Marabou has the error: Traceback (most recent call last):
File "", line 1, in
File "/opt/homebrew/lib/python3.9/site-packages/maraboupy/Marabou.py", line 17, in
from maraboupy.MarabouCore import *
ModuleNotFoundError: No module named 'maraboupy.MarabouCore'.

So I'm still not able to get it to work.

Hi @INPUTrrr0, you were very unlucky hitting that first bug when you built from source. It was only active for about 8 hours on the repo. If you pull and try running cmake again it should work?

Attempt of using "pip install maraboupy" results in "ERROR: Could not find a version that satisfies the requirement maraboupy (from versions: none)
ERROR: No matching distribution found for maraboupy".

As for this one, I'm afraid I'm not an expert on the Python building side of things, but can you give us your OS and your architecture? Maybe @wenkokke can help out?

Thank you @MatthewDaggitt for your suggestions. running cmake again gives me the following result:
Screen Shot 2024-02-18 at 0 31 43
I did still tried if it works by appending the path to PYTHONPATH: "echo $PYTHONPATH
PYTHONPATH:/Users/wind/Downloads/iclr2023/Marabou". But I'm still seeing "ModuleNotFoundError: No module named 'maraboupy'". I do see a binary file in Marabou/build. Should I set the pythonpath to this binary file?

As for pip, I'm able to perform "pip install marabou" on a conda env where I'm using "/opt/anaconda3/envs/nap/lib/python3.11" and I verified that marabou has these files: "/opt/anaconda3/envs/nap/bin/Marabou
/opt/anaconda3/envs/nap/lib/python3.11/site-packages/maraboupy-1.0.0.dist-info/*
/opt/anaconda3/envs/nap/lib/python3.11/site-packages/maraboupy/*".
Using this python3.11, I am able to import and use other packages such as numpy, but when I add the line "from maraboupy import Marabou", my terminal outputs: "zsh: illegal hardware instruction python3 scratch.py" (scratch.py is where I added the import line of code). My MacOS is 12.5 with M1 Pro.
Thanks again!

The issue is that there simply are no arm64 binaries for macOS <13.

There was no GitHub support for macOS arm64 builds, so the macOS arm64 binaries were built on my personal machine, which runs macOS 13.

It's possible to build macOS arm64 wheels for macOS >=11 using GitHub Actuons now, but that would require a PR and a new version release, which would likely take a very long time.

Thanks @wenkokke for your reply! I was able to run cmake and add the binary to my conda environment. However, I am met with this error: Screen Shot 2024-02-18 at 13 11 10
Is this a result of that one failed unit test? Thanks!

Not sure if there's any differences, but to be safe it's probably best to build from source using pip rather than directly calling CMake, e.g., by calling pip install ..

Closing due to inactivity. Feel free to reopen.