Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'gdal' #6

Open
shanjiang1994 opened this issue May 14, 2021 · 6 comments
Open

No module named 'gdal' #6

shanjiang1994 opened this issue May 14, 2021 · 6 comments

Comments

@shanjiang1994
Copy link

shanjiang1994 commented May 14, 2021

To whom it may concern,

Recently I'm following the tutorial of Extracting buildings and roads from AWS Open Data using Amazon SageMaker

When setup all environments and run the notebook I found:
import libs.solaris as sol is not working.
bu all dependencies have already satisfied

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-ef528ac68d82> in <module>
----> 1 import libs.solaris as sol

~/SageMaker/aws-open-data-satellite-lidar-tutorial/libs/solaris/__init__.py in <module>
----> 1 from . import bin, data, eval, nets, raster, tile, utils, vector
      2 
      3 __version__ = "0.2.2"

~/SageMaker/aws-open-data-satellite-lidar-tutorial/libs/solaris/data/__init__.py in <module>
      2 import pandas as pd
      3 import geopandas as gpd
----> 4 import gdal
      5 import rasterio
      6 

ModuleNotFoundError: No module named 'gdal'
@claudiamp
Copy link

claudiamp commented Jun 17, 2021

I'm getting the same errors when running the Road-Network.ipynb notebook

@shanjiang1994
Copy link
Author

I'm getting the same errors when running the Road-Network.ipynb notebook

I end up with the following actions. It may not be the best solution, but it temporarily works fine.

  1. Locate the file aws-open-data-satellite-lidar-tutorial/libs/solaris/data/__init__.py
  2. Delete or comment the import gdal
  3. Locate the file aws-open-data-satellite-lidar-tutorial/libs/solaris/utils/geo.py
  4. Delete or comment the import osr and gdal
  5. Within the notebook, add a cell and run from osgeo import gdal
  6. add a cell and run !pip install osr

@claudiamp
Copy link

Thanks @shanjiang1994, the steps worked for solving the issue

@aymanaboghonim
Copy link

I fixed this issue which is caused by the improper importing of gdal and osr.
when using conda we must import both libraries from osgeo package.

@abinshihab
Copy link

abinshihab commented Oct 2, 2021

Thank you @shanjiang1994 it is helped me.

@rhprasad0
Copy link

This is addressed in pull request #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants