diff --git a/README.md b/README.md index 3f71f740..70052b1e 100644 --- a/README.md +++ b/README.md @@ -332,10 +332,10 @@ libpostal needs to download some data files from S3. This is done automatically when you run make. Mapzen maintains an S3 bucket containing said data files but they can also be built manually. -To install via Python, just use: +To install via Python, you should first install the C library and then run: ``` -pip install git+https://github.com/openvenues/libpostal.git +python setup.py install ``` **Note**: The Python bindings don't implement libpostal's full API currently. diff --git a/setup.py b/setup.py index 78898968..3514a775 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,10 @@ import os +import subprocess from setuptools import setup, Extension, find_packages SRC_DIR = 'src' +this_dir = os.path.realpath(os.path.dirname(__file__)) def main(): @@ -21,7 +23,7 @@ def main(): 'utf8proc/utf8proc.c', ) ] + ['python/postal/text/pytokenize.c'], - include_dirs=['.'], + include_dirs=[this_dir], extra_compile_args=['-O0', '-std=c99', '-Wno-unused-function'], ), @@ -37,7 +39,7 @@ def main(): 'trie.c', 'trie_search.c',) ] + ['python/postal/text/pynormalize.c'], - include_dirs=['.'], + include_dirs=[this_dir], extra_compile_args=['-std=c99', '-DHAVE_CONFIG_H', '-Wno-unused-function'], ),