omniscale / imposm2

Imports OpenStreetMap data into geo databases
http://imposm.org
Apache License 2.0
116 stars 24 forks source link

runtime error with protobuf 2.6.x #47

Open tumluliu opened 9 years ago

tumluliu commented 9 years ago

I am on OS X 10.10.3, Python 2.7 (Homebrew version). I installed the deps via homebrew and pip, then the 2.6 version of imposm. But it seems that imposm requires 2.5 version of protobuf because I caught a runtime error:

Traceback (most recent call last): File "osm_parser.py", line 579, in p.parse('/Users/user/Research/data/OSM/munich.osm.pbf') File "/Library/Python/2.7/site-packages/imposm/parser/simple.py", line 62, in parse return self.parse_pbf_file(filename) File "/Library/Python/2.7/site-packages/imposm/parser/simple.py", line 72, in parse_pbf_file from imposm.parser.pbf.multiproc import PBFMultiProcParser File "/Library/Python/2.7/site-packages/imposm/parser/pbf/multiproc.py", line 17, in from imposm.parser.pbf.parser import PBFFile, PBFParser File "/Library/Python/2.7/site-packages/imposm/parser/pbf/parser.py", line 23, in from imposm.parser.pbf import OSMPBF ImportError: dlopen(/Library/Python/2.7/site-packages/imposm/parser/pbf/OSMPBF.so, 2): Library not loaded: /usr/local/lib/libprotobuf.8.dylib Referenced from: /Library/Python/2.7/site-packages/imposm/parser/pbf/OSMPBF.so Reason: image not found

The latest protobuf in homebrew is 2.6.1, and the lib file is libprotobuf.9.dylib. I tried making a symbolic link to libprotobuf.9.dylib by doing

$ ln /usr/local/lib/libprotobuf.9.dylib /usr/local/lib/libprotobuf.8.dylib

But no luck and got a new error:

Traceback (most recent call last): File "osm_parser.py", line 579, in p.parse('/Users/user/Research/data/OSM/munich.osm.pbf') File "/Library/Python/2.7/site-packages/imposm/parser/simple.py", line 62, in parse return self.parse_pbf_file(filename) File "/Library/Python/2.7/site-packages/imposm/parser/simple.py", line 72, in parse_pbf_file from imposm.parser.pbf.multiproc import PBFMultiProcParser File "/Library/Python/2.7/site-packages/imposm/parser/pbf/multiproc.py", line 17, in from imposm.parser.pbf.parser import PBFFile, PBFParser File "/Library/Python/2.7/site-packages/imposm/parser/pbf/parser.py", line 23, in from imposm.parser.pbf import OSMPBF ImportError: dlopen(/Library/Python/2.7/site-packages/imposm/parser/pbf/OSMPBF.so, 2): Symbol not found: __ZN6google8protobuf8internal12kEmptyStringE Referenced from: /Library/Python/2.7/site-packages/imposm/parser/pbf/OSMPBF.so Expected in: /usr/local/lib/libprotobuf.8.dylib in /Library/Python/2.7/site-packages/imposm/parser/pbf/OSMPBF.so

So I installed the protobuf at its specific version of 2.5.0 via homebrew:

$ brew unlink protobuf
$ brew install /homebrew/versions/protobuf250

And the problem is solved for the moment. Does imposm really require protobuf exactly at the 2.5 version?