I am having issues with the tutorial involving constructing the bulter. The problem doesn’t seem to be in my software but in the Butler repository in the tutorial. As this seems unlikely I imagine that I am doing something wrong but can’t determine what.
I am working through: “Getting started tutorial part 1: setting up the Butler data repository”
I am in python and have given the below commands:
from lsst.daf.butler import Butler
import os
repo_path = os.path.join(os.environ[‘RC2_SUBSET_DIR’], ‘SMALL_HSC’)
butler = Butler(repo_path)
I then get the following error message:
Failed to instantiate Butler from config file:///home/plah/programs/lsst_stack/rc2_subset/SMALL_HSC/butler.yaml.
Traceback (most recent call last):
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/base.py”, line 1900, in _execute_context
self.dialect.do_execute(
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/default.py”, line 736, in do_execute
cursor.execute(statement, parameters)
sqlite3.DatabaseError: file is not a database
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “”, line 1, in
File “/home/plah/programs/lsst_stack/stack/miniconda3-py38_4.9.2-4.1.0/Linux64/daf_butler/g3ee7dd65e6+24e5aa5155/python/lsst/daf/butler/_butler.py”, line 281, in init
self.registry = Registry.fromConfig(
File “/home/plah/programs/lsst_stack/stack/miniconda3-py38_4.9.2-4.1.0/Linux64/daf_butler/g3ee7dd65e6+24e5aa5155/python/lsst/daf/butler/registry/_registry.py”, line 230, in fromConfig
return registry_cls.fromConfig(config, butlerRoot, writeable, defaults)
File “/home/plah/programs/lsst_stack/stack/miniconda3-py38_4.9.2-4.1.0/Linux64/daf_butler/g3ee7dd65e6+24e5aa5155/python/lsst/daf/butler/registries/sql.py”, line 195, in fromConfig
managers = managerTypes.loadRepo(database)
File “/home/plah/programs/lsst_stack/stack/miniconda3-py38_4.9.2-4.1.0/Linux64/daf_butler/g3ee7dd65e6+24e5aa5155/python/lsst/daf/butler/registry/managers.py”, line 194, in loadRepo
with database.declareStaticTables(create=False) as context:
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/contextlib.py”, line 135, in enter
return next(self.gen)
File “/home/plah/programs/lsst_stack/stack/miniconda3-py38_4.9.2-4.1.0/Linux64/daf_butler/g3ee7dd65e6+24e5aa5155/python/lsst/daf/butler/registry/interfaces/_database.py”, line 654, in declareStaticTables
context = StaticTablesContext(self)
File “/home/plah/programs/lsst_stack/stack/miniconda3-py38_4.9.2-4.1.0/Linux64/daf_butler/g3ee7dd65e6+24e5aa5155/python/lsst/daf/butler/registry/interfaces/_database.py”, line 105, in init
self._tableNames = frozenset(self._inspector.get_table_names(schema=self._db.namespace))
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/reflection.py”, line 266, in get_table_names
return self.dialect.get_table_names(
File “”, line 2, in get_table_names
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/reflection.py”, line 55, in cache
ret = fn(self, con, *args, **kw)
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/dialects/sqlite/base.py”, line 1992, in get_table_names
rs = connection.exec_driver_sql(s)
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/base.py”, line 1760, in exec_driver_sql
return self._exec_driver_sql(
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/base.py”, line 1669, in _exec_driver_sql
ret = self._execute_context(
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/base.py”, line 1943, in _execute_context
self.handle_dbapi_exception(
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/base.py”, line 2124, in handle_dbapi_exception
util.raise(
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/util/compat.py”, line 208, in raise
raise exception
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/base.py”, line 1900, in _execute_context
self.dialect.do_execute(
File “/home/plah/programs/lsst_stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-4.1.0/lib/python3.10/site-packages/sqlalchemy/engine/default.py”, line 736, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) file is not a database
[SQL: SELECT name FROM sqlite_master WHERE type=‘table’ ORDER BY name]
(Background on this error at: Error Messages — SQLAlchemy 1.4 Documentation)
The error message seems to be saying that the tutorial data file is not a database which makes no sense as it would not have been put in the tutorial if it didn’t work. My research has not turned up anything useful. Does anyone have any ideas what is going wrong.