I was trying to rasterize a geojson using rasterio mask function but there is an issue with importing the function

ImportErrorTraceback (most recent call last)
<ipython-input-1-37fb1af87d72> in <module>()
      1 import json
      2 import rasterio
----> 3 from rasterio.tools.mask import mask

ImportError: No module named tools.mask

rasterio version: '1.0a9'

1 Answer 1


The mask module was moved, after 0.36 if I remember correctly, so you should instead import with:

from rasterio.mask import mask

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.