openvenues / pypostal

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

ModuleNotFoundError: No module named 'postal' #83

Open bryan-yen opened 2 years ago

bryan-yen commented 2 years ago

Hi,

I'm trying to set this up to be callable through an apache server on an ubuntu box. I followed the instructions and got everything installed. It seems to work fine when calling the script from Terminal. However, I get the following error in the apache logs when I make a call to apache to execute the script. I believe it might be some pathing issue. Any ideas will be appreciated.

File "/var/www/html/cgi-bin/get_parsedAddress.py", line 5, in from postal.parser import parse_address ModuleNotFoundError: No module named 'postal'

damienburke commented 4 months ago

in case it helps others... i noticed i got this when i omitted sudo from sudo make install. Just ensure that after u install the c lib, u see successful logging like:

address_parser/ address_parser/address_parser_crf.dat address_parser/address_parser_phrases.dat address_parser/address_parser_postal_codes.dat address_parser/address_parser_vocab.trie Checking for new libpostal language classifier data file... .... make[2]: Leaving directory '/tmp/libpostal/test' make[2]: Entering directory '/tmp/libpostal' make[2]: Leaving directory '/tmp/libpostal' make[1]: Leaving directory '/tmp/libpostal'