omniscale / imposm-parser

Deprecated: Python parser for OpenStreetMap data
http://imposm.org/docs/imposm.parser/latest/
Apache License 2.0
133 stars 57 forks source link

Error with pip install imposm.parser, header files not found #18

Open shiro900 opened 8 years ago

shiro900 commented 8 years ago

I am using python 2.7 and I am trying to pip install imposm.parser.

The first thing I did was to install protobuf with pip install protobuf. That installed version 2.6.1 in C:\Python27\Lib\site-packages\google. Then I went here to download protoc-2.6.1-build2-windows-x86_32.exe which I renamed to protoc.exe and placed in C:\Python27\Lib\site-packages\google folder.

I then installed Microsoft Visual C++ 9.0 from here

Finally, I executed pip install imposm.parser and this is the error I get:

running build_ext
building 'imposm.parser.pbf.OSMPBF' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\imposm
creating build\temp.win-amd64-2.7\Release\imposm\parser
creating build\temp.win-amd64-2.7\Release\imposm\parser\pbf
C:\Users\Shiro\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -C:\Python27\include -IC:\Python27\PC /Tpimposm/parser/pbf/osm.cc Fobuild\temp.win-amd64-2.7\Release\imposm/parser/pbf/osm.obj
  osm.cc
C:\Users\Shiro\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
c:\users\shiro\appdata\local\temp\pip-build-jel4jl\imposm.parser\imposm\parser\pbf\osm.pb.h(9) : fatal error C1083: Cannot open include file: 'google/protobuf/stubs/common.h': No such file or directory
error: command '"C:\Users\Shiro\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe"' failed with exit status 2

Edit: The header header file saying that is missing is from protobuf which I just installed with pip install protobuf. The file missing is right here in the github google/protobuf/stubs/common.h shouldn't it exist on my system since I installed with pip ? I don't understand...

CTLocalGovTeam commented 8 years ago

I have the same issue.

and i see the same error, "missing common.h"

@shiro900, were you ever successful in setting this up? I am doing on a windows 7 64-bit machine with 32-bit Python 2.7.10

codergh commented 7 years ago

@shiro900

I also got the problem. were you ever successful in setting this up? Or do you have any other method to solve this problem?

stigbosmans commented 7 years ago

Same problem here, did anyone find a solution yet?

TimMcCauley commented 6 years ago

For Ubuntu 16.04 I had to install google protobuf from source, instructions to be found here: https://github.com/google/protobuf/blob/master/src/README.md

For OS X it will suffice if you install protobuf via brew install protobuf

colmjude commented 6 years ago

Thanks @TimMcCauley, that worked a treat for me.

philippos86 commented 6 years ago

@TimMcCauley Thanks Tim for your comment. I had the same issue as @shiro900 , and your linked helped configuring on mac. However, on windows, I still face the same problem. Basically, I work from cygwin terminal on Windows 7, and I miss the last command ldconfig. Do you have any advice to solve this issue?

TimMcCauley commented 6 years ago

@philippos86 - unfortunately not, does google help? https://www.google.de/search?q=ldconfig+cygwin&oq=ldconfig+cygwin&aqs=chrome..69i57j0l4.2300j0j7&sourceid=chrome&ie=UTF-8

philippos86 commented 6 years ago

@TimMcCauley I googled it already, apparently Idconfig is only for mac. Also, the documentation says it is only for mac os or linux: https://imposm.org/docs/imposm/latest/# so I am not sure if it could be configured for windows.