libpostal icon indicating copy to clipboard operation
libpostal copied to clipboard

Error loading transliteration module, dir=(null) at libpostal_setup_datadir (libpostal.c:290) errno: No such file or directory

Open hamza1ettaki opened this issue 3 years ago • 8 comments

Hi!

I tried to build libpostal on my Conda environment :

conda activate condaenv
conda install libpostal -y
conda install postal -y
pip install scrubadub==2.0.0
pip install scrubadub_spacy
pip install scrubadub_address

After installing all requirements, I tried to send my script to the cluster with the conda environment using spark-submit command for processing:

spark-submit \ 
--name processing_addresses  \  
--master yarn \  
--deploy-mode cluster \  
.
.
.
--conf spark.yarn.appMasterEnv.PYSPARK_PYTHON=./condaenv/bin/python \
--conf spark.yarn.appMasterEnv.PYSPARK_DRIVER_PYTHON=./condaenv/bin/python \
--conf spark.executorEnv.PYSPARK_PYTHON=./condaenv/bin/python \
--conf spark.executorEnv.PYSPARK_DRIVER_PYTHON=./condaenv/bin/python \
--archives /path/to/env/condaenv.tar.gz#condaenv \
./myscript.py

My job fail with this error :

ERR   Error loading transliteration module, dir=(null)
   at libpostal_setup_datadir (libpostal.c:290) errno: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/condaenv/lib/python3.7/site-packages/scrubadub_address/__init__.py", line 1, in <module>
    from . import detectors
  File "/home/condaenv/lib/python3.7/site-packages/scrubadub_address/detectors/__init__.py", line 1, in <module>
    from .address import AddressDetector
  File "/home/condaenv/lib/python3.7/site-packages/scrubadub_address/detectors/address.py", line 4, in <module>
    import postal.parser
  File "/home/condaenv/lib/python3.7/site-packages/postal/parser.py", line 2, in <module>
    from postal import _parser
SystemError: initialization of _parser raised unreported exception

The libpostal work on my local environment if I don't change the location of my conda environment, Also when I try to change the name of my conda environment locally the libpostal doesn't work for me.

How could I resolve this?

Thank you

hamza1ettaki avatar Nov 03 '21 19:11 hamza1ettaki

Same issue for me on windows using msys2.

shivamspj avatar Nov 22 '21 10:11 shivamspj

Same issue for me on windows using msys2.

https://github.com/selva221724/pypostalwin

selva221724 avatar Dec 02 '21 18:12 selva221724

Hi!

I tried to build libpostal on my Conda environment :

conda activate condaenv
conda install libpostal -y
conda install postal -y
pip install scrubadub==2.0.0
pip install scrubadub_spacy
pip install scrubadub_address

After installing all requirements, I tried to send my script to the cluster with the conda environment using spark-submit command for processing:

spark-submit \ 
--name processing_addresses  \  
--master yarn \  
--deploy-mode cluster \  
.
.
.
--conf spark.yarn.appMasterEnv.PYSPARK_PYTHON=./condaenv/bin/python \
--conf spark.yarn.appMasterEnv.PYSPARK_DRIVER_PYTHON=./condaenv/bin/python \
--conf spark.executorEnv.PYSPARK_PYTHON=./condaenv/bin/python \
--conf spark.executorEnv.PYSPARK_DRIVER_PYTHON=./condaenv/bin/python \
--archives /path/to/env/condaenv.tar.gz#condaenv \
./myscript.py

My job fail with this error :

ERR   Error loading transliteration module, dir=(null)
   at libpostal_setup_datadir (libpostal.c:290) errno: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/condaenv/lib/python3.7/site-packages/scrubadub_address/__init__.py", line 1, in <module>
    from . import detectors
  File "/home/condaenv/lib/python3.7/site-packages/scrubadub_address/detectors/__init__.py", line 1, in <module>
    from .address import AddressDetector
  File "/home/condaenv/lib/python3.7/site-packages/scrubadub_address/detectors/address.py", line 4, in <module>
    import postal.parser
  File "/home/condaenv/lib/python3.7/site-packages/postal/parser.py", line 2, in <module>
    from postal import _parser
SystemError: initialization of _parser raised unreported exception

The libpostal work on my local environment if I don't change the location of my conda environment, Also when I try to change the name of my conda environment locally the libpostal doesn't work for me.

How could I resolve this?

Thank you

Try this one out: https://github.com/selva221724/pypostalwin

selva221724 avatar Dec 02 '21 18:12 selva221724

same error on ubuntu 20.04.

ERR Error loading transliteration module, dir=(null) at libpostal_setup_datadir (libpostal.c:290) errno: No such file or directory

pratt-lightbeam avatar Dec 19 '21 05:12 pratt-lightbeam

anyone has solved this issue?

CurisZhou avatar Jan 17 '22 09:01 CurisZhou

Just install afresh. Spent weeks on libpostal errors (this one too). It has something to do with the installation steps. (will comment within a day if I find the commands)

pratt3000 avatar Jan 17 '22 22:01 pratt3000

Finally, I have solved this issue.

I use libpostal with python binding. A good way to use libpostal python binding is to install this library pylibpostal 1.0.0 instead.

When I used pylibpostal 1.0.0 in my environment(Centos 7, Jupyter notebook), I met this issue. The reason is that my jupyter notebook cannot read the environment variable LIBPOSTAL_DATA_DIR that path storing the data files of libpostal. Hence, I explicitly set the environment variable LIBPOSTAL_DATA_DIR in my code before importing the pylibpostal os.environ['LIBPOSTAL_DATA_DIR']='your absolute path to store data files of libpostal'

CurisZhou avatar Jan 18 '22 12:01 CurisZhou

if you are looking for an unofficial python binding in windows, please use this python package. It can work very well in windows

https://github.com/selva221724/pypostalwin

alt text

selva221724 avatar Apr 11 '22 06:04 selva221724