hotosm / osm-export-tool-python

command line tool + Python library for exporting OSM in various file formats.
BSD 3-Clause "New" or "Revised" License
44 stars 11 forks source link

AttributeError: module 'ogr' has no attribute 'osr' #17

Closed Chaz6 closed 4 years ago

Chaz6 commented 4 years ago

I installed osm-export-tool using pip with python 3.8 on Linux 64bit. When I try to run osm-export-tool the following output is displayed:-

Traceback (most recent call last):
  File "/home/chaz/.local/bin/osm-export-tool", line 3, in <module>
    from osm_export_tool.cmd import main
  File "/home/chaz/.local/lib/python3.8/site-packages/osm_export_tool/cmd.py", line 5, in <module>
    import osm_export_tool.tabular as tabular
  File "/home/chaz/.local/lib/python3.8/site-packages/osm_export_tool/tabular.py", line 14, in <module>
    epsg_4326 = ogr.osr.SpatialReference()
AttributeError: module 'ogr' has no attribute 'osr'

$ python3.8
Python 3.8.1 (default, Feb  5 2020, 18:34:56)
[Clang 9.0.1 (/home/chaz/git/github.com_syoyo_llvm-build-script/llvm-src-9.0.1/ on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ogr
>>> dir(ogr)
['DistributionNotFound', 'GithubService', 'GitlabService', 'PagureService', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'abstract', 'constant', 'deprecation', 'exceptions', 'factory', 'get_distribution', 'get_instances_from_dict', 'get_project', 'get_service_class', 'get_service_class_or_none', 'parsing', 'read_only', 'services', 'utils']