stac-utils/stac-asset

AttributeError: module 'pystac' has no attribute 'from_file'

amanbagrecha opened this issue · 1 comments

I tried running the example given in the readme and got the following error.

import pystac
import stac_asset

href = "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/simple-item.json"
item = pystac.from_file(href)
item = await stac_asset.download_item(item, ".")

error

AttributeError: module 'pystac' has no attribute 'from_file'

What worked

Applying from_file method on Item object worked fine

from pystac import Item
import stac_asset

href = "https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/simple-item.json"
item = Item.from_file(href)
item = await stac_asset.download_item(item, ".")

version

pystac=1.8.3

Good catch @amanbagrecha.