Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import pybertini in python got RuntimeError: unidentifiable C++ exception #189

Open
SeffyVon opened this issue Oct 18, 2023 · 1 comment

Comments

@SeffyVon
Copy link

Hi, I am using Mac Montery OS with M1 Max Chip, and homebrew to install all the dependencies.

  • mpfr: 4.2.0-p12
  • gmp: 6.2.1_1
  • boost: 1.82.0_1
  • eigen: 3.4.0_1
  • boost-python3: 1.82.0
  • python3: 3.11.6
  1. I configured b2/core and make-installed the core to /usr/local/ using the following command, with only 9 PASS and 1 FAIL (b2_class_test).
./configure CPPFLAGS="-I/opt/homebrew/include -DBOOST_PHOENIX_STL_TUPLE_H_" LDFLAGS="-L/opt/homebrew/lib" --with-eigen="/opt/homebrew/Cellar/eigen/3.4.0_1/include/eigen3/" 
  1. I then configured b2/python using
./configure CPPFLAGS="-I/opt/homebrew/include -DBOOST_PHOENIX_STL_TUPLE_H_" LDFLAGS="-L/opt/homebrew/lib" --with-eigen="/opt/homebrew/Cellar/eigen/3.4.0_1/include/eigen3/"  --with-eigenpy="/opt/homebrew/lib/python3.11/site-packages/cmeel.prefix"  --with-boost-python="/opt/homebrew/Cellar/boost-python3/1.82.0/"

command, then make-installed.

  1. pip3 install --upgrade .

  2. I ran python3 and import pybertini, but I got the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.11/site-packages/pybertini/__init__.py", line 53, in <module>
    import pybertini.function_tree as function_tree
  File "/opt/homebrew/lib/python3.11/site-packages/pybertini/function_tree/__init__.py", line 31, in <module>
    import _pybertini
ModuleNotFoundError: No module named '_pybertini'

I think this is because the _pybertini.so was installed in /usr/local/lib/python3.11/site-packages, outside the PYTHONPATH, so I added export PYTHONPATH=/usr/local/lib/python3.11/site-packages:$PYTHONPATH.

  1. Again, I ran python3 and import pybertini. This time another error appeared:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.11/site-packages/pybertini/__init__.py", line 53, in <module>
    import pybertini.function_tree as function_tree
  File "/opt/homebrew/lib/python3.11/site-packages/pybertini/function_tree/__init__.py", line 31, in <module>
    import _pybertini
RuntimeError: unidentifiable C++ exception

I attached config.log under b2/python. Please help, thank you!

@ofloveandhate
Copy link
Contributor

Your setup seems spot-on, through adding the location of the .so library to PYTHONPATH.

  • I expect that failing test in b2_class_test due to a bug in Boost 1.82 (I think it's fixed in 1.83?).

I'm curious about what exception got generated. I'll try to take a look. It might be as simple as bringing my most recent changes from my fork to the "official" repo (this one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants