Symbol not found: _mpfr_acos, Expected in: flat namespace

461 Views Asked by At

I am trying to run a Python script that includes multiple packages. The error I continuously get involves the mpfr.so file (MPFR module). Here are the contents of the entire message:

Traceback (most recent call last):
  File "/Users/rebekahgruver/Desktop/solver/spopt-stable/SpOpt.py", line 3, in <module>
    from bigfloat import BigFloat
  File "/Users/rebekahgruver/Desktop/macPKG/venv/lib/python2.7/site-packages/bigfloat/__init__.py", line 107, in <module>
    from bigfloat.core import (
  File "/Users/rebekahgruver/Desktop/macPKG/venv/lib/python2.7/site-packages/bigfloat/core.py", line 26, in <module>
    import mpfr
ImportError: dlopen(/Users/rebekahgruver/Desktop/macPKG/venv/lib/python2.7/site-packages/mpfr.so, 2): Symbol not found: _mpfr_acos
  Referenced from: /Users/rebekahgruver/Desktop/macPKG/venv/lib/python2.7/site-packages/mpfr.so
  Expected in: flat namespace 

I have gone in circles trying to reinstall the packages and haven't been able to solve it.

1

There are 1 best solutions below

1
Joe Young On

Looks like you need missing libraries MPFR and possibly GMP. If you have homebrew installed on your system, try:

brew install gmp
brew install mpfr

In order to use the bigfloat package you will need to have both the GMP and MPFR libraries already installed on your system, along with the include files for those libraries. See the MPFR homepage and the GMP homepage for more information about these libraries. Currently, MPFR version 2.3.0 or later is required.

Source: http://pythonhosted.org/bigfloat/#prerequisites