NCPP / ocgis

OpenClimateGIS is a set of geoprocessing and calculation tools for CF-compliant climate datasets.
Other
70 stars 19 forks source link

Module 'ogr' has no attribute 'Open' #521

Open mkmitchell opened 3 years ago

mkmitchell commented 3 years ago

It seems like every year or two I have to run code I wrote in 2016 and I come back here for some help getting it going again. Thank you for the continued help.

Here is what I've tried so far. I couldn't create the environment within windows conda so I'm using the windows subsystem for linux (ubuntu 20.04). I installed conda and cloned the ocgis repo then ran conda env create -f environment.yml After activating I tried to run https://github.com/mkmitchell/WSI_Processing/blob/master/OCGIS_summarize_by_polygon.py but it failed because ogr wasn't found. I installed ogr with pip3 install --user ogr then ran it again and got

Traceback (most recent call last):
  File "OCGIS_summarize_by_polygon.py", line 32, in doCalc
    ops.execute()
********
    ds = ogr.Open(shp_path)
AttributeError: module 'ogr' has no attribute 'Open'

I removed a lot of the error above to the important stuff. If I import ogr I can run ogr.Open and it works fine.

Think you can help me out? Thanks