openvenues / libpostal

A C library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.
MIT License
4.08k stars 419 forks source link

Issues with Windows Installation #603

Open RiccardoGTolli opened 2 years ago

RiccardoGTolli commented 2 years ago

Hi!

I followed the instruction to install libpostal on windows using MSys2/MinGW.

But I am getting this error when I do pip install postal:

$ pip install postal Collecting postal Using cached postal-1.1.10.tar.gz (21 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: six in c:\users\riccardotolli\appdata\roaming\python\python39\site-packages (from postal) (1.16.0) Building wheels for collected packages: postal Building wheel for postal (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [30 lines of output] C:\Users\RiccardoTolli\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\postal copying postal\dedupe.py -> build\lib.win-amd64-3.9\postal copying postal\expand.py -> build\lib.win-amd64-3.9\postal copying postal\near_dupe.py -> build\lib.win-amd64-3.9\postal copying postal\normalize.py -> build\lib.win-amd64-3.9\postal copying postal\parser.py -> build\lib.win-amd64-3.9\postal copying postal\tokenize.py -> build\lib.win-amd64-3.9\postal copying postal\token_types.py -> build\lib.win-amd64-3.9\postal copying postal__init.py -> build\lib.win-amd64-3.9\postal creating build\lib.win-amd64-3.9\postal\tests copying postal\tests\test_expand.py -> build\lib.win-amd64-3.9\postal\tests copying postal\tests\test_parser.py -> build\lib.win-amd64-3.9\postal\tests copying postal\tests_test_near_dupes.py -> build\lib.win-amd64-3.9\postal\tests copying postal\tests\init.py -> build\lib.win-amd64-3.9\postal\tests creating build\lib.win-amd64-3.9\postal\utils copying postal\utils\encoding.py -> build\lib.win-amd64-3.9\postal\utils copying postal\utils\enum.py -> build\lib.win-amd64-3.9\postal\utils copying postal\utils\omitted.py -> build\lib.win-amd64-3.9\postal\utils copying postal\utils\init__.py -> build\lib.win-amd64-3.9\postal\utils copying postal\pyutils.h -> build\lib.win-amd64-3.9\postal running build_ext building 'postal._expand' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for postal Running setup.py clean for postal Failed to build postal Installing collected packages: postal Running setup.py install for postal ... error error: subprocess-exited-with-error

× Running setup.py install for postal did not run successfully. │ exit code: 1 ╰─> [30 lines of output] C:\Users\RiccardoTolli\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py:697: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\postal copying postal\dedupe.py -> build\lib.win-amd64-3.9\postal copying postal\expand.py -> build\lib.win-amd64-3.9\postal copying postal\near_dupe.py -> build\lib.win-amd64-3.9\postal copying postal\normalize.py -> build\lib.win-amd64-3.9\postal copying postal\parser.py -> build\lib.win-amd64-3.9\postal copying postal\tokenize.py -> build\lib.win-amd64-3.9\postal copying postal\token_types.py -> build\lib.win-amd64-3.9\postal copying postal__init.py -> build\lib.win-amd64-3.9\postal creating build\lib.win-amd64-3.9\postal\tests copying postal\tests\test_expand.py -> build\lib.win-amd64-3.9\postal\tests copying postal\tests\test_parser.py -> build\lib.win-amd64-3.9\postal\tests copying postal\tests_test_near_dupes.py -> build\lib.win-amd64-3.9\postal\tests copying postal\tests\init.py -> build\lib.win-amd64-3.9\postal\tests creating build\lib.win-amd64-3.9\postal\utils copying postal\utils\encoding.py -> build\lib.win-amd64-3.9\postal\utils copying postal\utils\enum.py -> build\lib.win-amd64-3.9\postal\utils copying postal\utils\omitted.py -> build\lib.win-amd64-3.9\postal\utils copying postal\utils\init__.py -> build\lib.win-amd64-3.9\postal\utils copying postal\pyutils.h -> build\lib.win-amd64-3.9\postal running build_ext building 'postal._expand' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> postal

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

RiccardoGTolli commented 2 years ago

If I install Microsoft Visual C++ Build Tools the error changes to :

  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\postal
  copying postal\dedupe.py -> build\lib.win-amd64-3.9\postal
  copying postal\expand.py -> build\lib.win-amd64-3.9\postal
  copying postal\near_dupe.py -> build\lib.win-amd64-3.9\postal
  copying postal\normalize.py -> build\lib.win-amd64-3.9\postal
  copying postal\parser.py -> build\lib.win-amd64-3.9\postal
  copying postal\tokenize.py -> build\lib.win-amd64-3.9\postal
  copying postal\token_types.py -> build\lib.win-amd64-3.9\postal
  copying postal\__init__.py -> build\lib.win-amd64-3.9\postal
  creating build\lib.win-amd64-3.9\postal\tests
  copying postal\tests\test_expand.py -> build\lib.win-amd64-3.9\postal\tests
  copying postal\tests\test_parser.py -> build\lib.win-amd64-3.9\postal\tests
  copying postal\tests\_test_near_dupes.py -> build\lib.win-amd64-3.9\postal\tests
  copying postal\tests\__init__.py -> build\lib.win-amd64-3.9\postal\tests
  creating build\lib.win-amd64-3.9\postal\utils
  copying postal\utils\encoding.py -> build\lib.win-amd64-3.9\postal\utils
  copying postal\utils\enum.py -> build\lib.win-amd64-3.9\postal\utils
  copying postal\utils\omitted.py -> build\lib.win-amd64-3.9\postal\utils
  copying postal\utils\__init__.py -> build\lib.win-amd64-3.9\postal\utils
  copying postal\pyutils.h -> build\lib.win-amd64-3.9\postal
  running build_ext
  building 'postal._expand' extension
  creating build\temp.win-amd64-3.9
  creating build\temp.win-amd64-3.9\Release
  creating build\temp.win-amd64-3.9\Release\postal
  C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include -Ic:\Users\RiccardoTolli\AppData\Local\Programs\Python\Python39\include -Ic:\Users\RiccardoTolli\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um /Tcpostal/pyexpand.c /Fobuild\temp.win-amd64-3.9\Release\postal/pyexpand.obj -std=c99
  cl : Command line warning D9002 : ignoring unknown option '-std=c99'
  pyexpand.c
  postal/pyexpand.c(2): fatal error C1083: Cannot open include file: 'libpostal/libpostal.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> postal

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

padminigiri commented 1 year ago

I'm also getting the same issue: Collecting postal Using cached postal-1.1.10.tar.gz (21 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: six in d:\cloud3\svn_cdifrevamp\projectprovenance\venv\lib\site-packages (from postal) (1.16.0) Building wheels for collected packages: postal Building wheel for postal (setup.py): started Building wheel for postal (setup.py): finished with status 'error' Running setup.py clean for postal Failed to build postal Installing collected packages: postal Running setup.py install for postal: started Running setup.py install for postal: finished with status 'error'

error: subprocess-exited-with-error

python setup.py bdist_wheel did not run successfully. exit code: 1

[41 lines of output] D:\Cloud3\svn_cdifrevamp\ProjectProvenance\venv\lib\site-packages\setuptools\dist.py:691: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( D:\Cloud3\svn_cdifrevamp\ProjectProvenance\venv\lib\site-packages\setuptools\dist.py:691: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.10 creating build\lib.win-amd64-3.10\postal copying postal\dedupe.py -> build\lib.win-amd64-3.10\postal copying postal\expand.py -> build\lib.win-amd64-3.10\postal copying postal\near_dupe.py -> build\lib.win-amd64-3.10\postal copying postal\normalize.py -> build\lib.win-amd64-3.10\postal copying postal\parser.py -> build\lib.win-amd64-3.10\postal copying postal\tokenize.py -> build\lib.win-amd64-3.10\postal copying postal\token_types.py -> build\lib.win-amd64-3.10\postal copying postal__init.py -> build\lib.win-amd64-3.10\postal creating build\lib.win-amd64-3.10\postal\tests copying postal\tests\test_expand.py -> build\lib.win-amd64-3.10\postal\tests copying postal\tests\test_parser.py -> build\lib.win-amd64-3.10\postal\tests copying postal\tests_test_near_dupes.py -> build\lib.win-amd64-3.10\postal\tests copying postal\tests\init.py -> build\lib.win-amd64-3.10\postal\tests creating build\lib.win-amd64-3.10\postal\utils copying postal\utils\encoding.py -> build\lib.win-amd64-3.10\postal\utils copying postal\utils\enum.py -> build\lib.win-amd64-3.10\postal\utils copying postal\utils\omitted.py -> build\lib.win-amd64-3.10\postal\utils copying postal\utils\init__.py -> build\lib.win-amd64-3.10\postal\utils copying postal\pyutils.h -> build\lib.win-amd64-3.10\postal warning: build_py: byte-compiling is disabled, skipping.

running build_ext building 'postal._expand' extension creating build\temp.win-amd64-3.10 creating build\temp.win-amd64-3.10\Release creating build\temp.win-amd64-3.10\Release\postal C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include -ID:\Cloud3\svn_cdifrevamp\ProjectProvenance\venv\include -IC:\Users\PadminiGiri\AppData\Local\Programs\Python\Python310\include -IC:\Users\PadminiGiri\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE -IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt /Tcpostal/pyexpand.c /Fobuild\temp.win-amd64-3.10\Release\postal/pyexpand.obj -std=c99 cl : Command line warning D9002 : ignoring unknown option '-std=c99' pyexpand.c postal/pyexpand.c(2): fatal error C1083: Cannot open include file: 'libpostal/libpostal.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for postal error: subprocess-exited-with-error

Running setup.py install for postal did not run successfully. exit code: 1

[41 lines of output] D:\Cloud3\svn_cdifrevamp\ProjectProvenance\venv\lib\site-packages\setuptools\dist.py:691: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( D:\Cloud3\svn_cdifrevamp\ProjectProvenance\venv\lib\site-packages\setuptools\dist.py:691: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install running build running build_py creating build creating build\lib.win-amd64-3.10 creating build\lib.win-amd64-3.10\postal copying postal\dedupe.py -> build\lib.win-amd64-3.10\postal copying postal\expand.py -> build\lib.win-amd64-3.10\postal copying postal\near_dupe.py -> build\lib.win-amd64-3.10\postal copying postal\normalize.py -> build\lib.win-amd64-3.10\postal copying postal\parser.py -> build\lib.win-amd64-3.10\postal copying postal\tokenize.py -> build\lib.win-amd64-3.10\postal copying postal\token_types.py -> build\lib.win-amd64-3.10\postal copying postal__init.py -> build\lib.win-amd64-3.10\postal creating build\lib.win-amd64-3.10\postal\tests copying postal\tests\test_expand.py -> build\lib.win-amd64-3.10\postal\tests copying postal\tests\test_parser.py -> build\lib.win-amd64-3.10\postal\tests copying postal\tests_test_near_dupes.py -> build\lib.win-amd64-3.10\postal\tests copying postal\tests\init.py -> build\lib.win-amd64-3.10\postal\tests creating build\lib.win-amd64-3.10\postal\utils copying postal\utils\encoding.py -> build\lib.win-amd64-3.10\postal\utils copying postal\utils\enum.py -> build\lib.win-amd64-3.10\postal\utils copying postal\utils\omitted.py -> build\lib.win-amd64-3.10\postal\utils copying postal\utils\init__.py -> build\lib.win-amd64-3.10\postal\utils copying postal\pyutils.h -> build\lib.win-amd64-3.10\postal warning: build_py: byte-compiling is disabled, skipping.

running build_ext building 'postal._expand' extension creating build\temp.win-amd64-3.10 creating build\temp.win-amd64-3.10\Release creating build\temp.win-amd64-3.10\Release\postal C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/local/include -ID:\Cloud3\svn_cdifrevamp\ProjectProvenance\venv\include -IC:\Users\PadminiGiri\AppData\Local\Programs\Python\Python310\include -IC:\Users\PadminiGiri\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE -IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt /Tcpostal/pyexpand.c /Fobuild\temp.win-amd64-3.10\Release\postal/pyexpand.obj -std=c99 cl : Command line warning D9002 : ignoring unknown option '-std=c99' pyexpand.c postal/pyexpand.c(2): fatal error C1083: Cannot open include file: 'libpostal/libpostal.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

Encountered error while trying to install package.

postal

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.