yannforget / pylandsat

Search, download, and preprocess Landsat imagery 🛰️
MIT License
65 stars 18 forks source link

Error: 'sqlite3.Connection' object has no attribute 'enable_load_extension' #14

Open shanedoolane opened 2 years ago

shanedoolane commented 2 years ago

Trying to run

from datetime import datetime
from shapely.geometry import Point
from pylandsat import Catalog, Product

catalog = Catalog()

begin = datetime(2010, 1, 1)
end = datetime(2020, 1, 1)
geom = Point(4.34, 50.85)

# Results are returned as a list
scenes = catalog.search(
    begin=begin,
    end=end,
    geom=geom,
    sensors=['LE07', 'LC08']
)

product_id = scenes[0].get("product_id")

print(scenes)

but erroring out with sqllite3 problem. Anyone seen this issue? Running on pycharm installation

relativityhd commented 6 months ago

You need to install Python with some Feature flags. I deinstalled my python an reinstalled it with PyEnv. Before installing the python version I installed some other libraries which are then automaticly used by PyEnv for the install:

$ sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev libsqlite3-mod-spatialite curl \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
$  PYTHON_CONFIGURE_OPTS="--enable-loadable-sqlite-extensions --enable-optimizations" pyenv install 3.11

Hope this helps