openvenues / pypostal

Python bindings to libpostal for fast international address parsing/normalization
MIT License
766 stars 88 forks source link

Symbol not found: _libpostal_address_parser_response_destroy on macos M1 #70

Open somesh636 opened 3 years ago

somesh636 commented 3 years ago

I am getting this error on macos M1 core and I have tried to compile the source code to regenerate the .so files. However, I am unable to resolve this issue. The detail of the error is as below.

from postal import _parser ImportError: dlopen(/Users/someshgupta/opt/anaconda3/envs/fd_analysis/lib/python3.6/site-packages/postal/_parser.cpython-36m-darwin.so, 2): Symbol not found: _libpostal_address_parser_response_destroy Referenced from: /Users/someshgupta/opt/anaconda3/envs/fd_analysis/lib/python3.6/site-packages/postal/_parser.cpython-36m-darwin.so Expected in: flat namespace in /Users/someshgupta/opt/anaconda3/envs/fd_analysis/lib/python3.6/site-packages/postal/_parser.cpython-36m-darwin.so

Is there a way to resolve this issue?

rjurney commented 3 years ago

+1

lorenzodemiri commented 2 years ago

Hi guys, have you found a way to solve this issue?

JochenFromm commented 2 years ago

In my case the only thing that helped on a new M1 MacBook was to switch from Python version 3.6 or 3.8 (which apparently do not work) to 3.9 or 3.10. See https://github.com/openvenues/libpostal/issues/585

proxhavasi commented 9 months ago

+1

JochenFromm commented 3 months ago

I met the problem again on an M1 MacBook and this time it only helped to create an x68 environment. Otherwise nothing helped, even if the terminal is already in an i386 mode using Rosetta it is apparently not enough for newer Conda versions. Conda can create x86 environments on Mac Arm as described here

conda create -n my_x86_env -y
conda activate my_x86_env
conda config --env --set subdir osx-64
conda install python=3.11
rjurney commented 3 months ago

Have you built libpostal for OS X? I've found that make distclean and rebuilding with SSE off can help this kind of issue. Also, the new Senzing model works much better.

git clone https://github.com/openvenues/libpostal.git
cd libpostal
make distclean
./bootstrap.sh
# Disable SSE2 so it will work on Apple ARM processors (optional)
./configure –datadir=/tmp –disable-sse2 MODEL=senzing
make -j6
make install
JochenFromm commented 3 months ago

yes, but without the senzing model parameter and with -j4 instead of -j6

rjurney commented 3 months ago

Be sure to run make distclean before rebuilding.