Repository: truera/trulens
Issue: [BUG] Tru() function fails either due to missing alembic.ini file or KeyError: 'formatters'
Root cause: Configuration Error

**Bug Description**
After pip installing trulens_eval v0.28.0, running tru = Tru(), gives an error related to either a missing alembic `alembic.ini` file (lib/python3.12/site-packages/trulens_eval/database/migrations/alembic.ini ) or a key error as shown below. Downgrading to v0.27.0 resolved the issue.

**To Reproduce**
Tested on ubuntu (22.04) and MacOS (14.4.1, Intel)
`pip install trulens_eval==0.28.0
python
>>> from trulens_eval import Tru 
>>> tru = Tru()`

**Expected behavior**
Tru initialises without issue

**Relevant Logs/Tracebacks**
tru = Tru() %s Tru initialized with db url %s . 🦑 sqlite:///default.sqlite 🛑 Secret keys may be written to the database. See the database_redact_keys option of Tru` to prevent this. Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/ubuntu/.local/lib/python3.10/site-packages/trulens_eval/tru.py", line 200, in init self.db.check_db_revision() File "/home/ubuntu/.local/lib/python3.10/site-packages/trulens_eval/database/sqlalchemy.py", line 210, in check_db_revision alembic_check_db_revision(self.engine, self.table_prefix) File "/home/ubuntu/.local/lib/python3.10/site-packages/trulens_eval/database/utils.py", line 199, in check_db_revision upgrade_db( File "/home/ubuntu/.local/lib/python3.10/site-packages/trulens_eval/database/migrations/init.py", line 46, in upgrade_db command.upgrade(config, revision) File "/home/ubuntu/.local/lib/python3.10/site-packages/alembic/command.py", line 403, in upgrade script.run_env() File "/home/ubuntu/.local/lib/python3.10/site-packages/alembic/script/base.py", line 583, in run_env util.load_python_file(self.dir, "env.py") File "/home/ubuntu/.local/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file module = load_module_py(module_id, path) File "/home/ubuntu/.local/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py spec.loader.exec_module(module) # type: ignore File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/home/ubuntu/.local/lib/python3.10/site-packages/trulens_eval/database/migrations/env.py", line 21, in <module> fileConfig(config.config_file_name) File "/usr/lib/python3.10/logging/config.py", line 72, in fileConfig formatters = _create_formatters(cp) File "/usr/lib/python3.10/logging/config.py", line 105, in _create_formatters flist = cp["formatters"]["keys"] File "/usr/lib/python3.10/configparser.py", line 965, in getitem raise KeyError(key) KeyError: 'formatters'

**Environment:**
 - OS: Ubuntu (22.04) and MacOS (14.4.1, Intel)
 - Python Version: 3.10, 3.12
 - TruLens version: 0.28.0
 - Versions of other relevant installed libraries:
alembic = 1.13.1
SQLAlchemy = 2.0.29


<!-- Answer -->
The issue you're encountering with `trulens_eval` version 0.28.0, related to either a missing `alembic.ini` file or a `KeyError` for 'formatters', seems to stem from changes or missing configurations in this specific version. The `alembic.ini` file is crucial for Alembic to manage database migrations, and the `KeyError` suggests a possible misconfiguration or missing section in this file or related configuration files.

To address this issue, consider the following steps:

1. **Verify Installation and Dependencies**: Ensure that all dependencies are correctly installed. This includes not only `trulens_eval` but also `alembic` and `SQLAlchemy`, as they are closely tied to the functionality that seems to be failing.

2. **Check for Version Conflicts**: Use utilities provided by `trulens_eval` to check for any version conflicts among installed packages, especially those related to `alembic` and `SQLAlchemy`.

3. **Review Documentation or Source Code**: If possible, review the `trulens_eval` documentation or source code for any notes on changes to the `Tru()` function or database migration process between versions 0.27.0 and 0.28.0.

4. **Reach Out to Maintainers**: If the issue persists, consider reaching out to the `trulens_eval` maintainers for more direct support, as they may offer specific guidance or acknowledge a known issue with the version in question.

Downgrading to version 0.27.0 as a temporary workaround is sensible, but for a long-term solution, following these steps should help identify and resolve the root cause of the problem.

## Sources
- [trulens_eval/trulens_eval/utils/imports.py](https://github.com/truera/trulens/blob/main/trulens_eval/trulens_eval/utils/imports.py)
- [trulens_eval/trulens_eval/database/migrations/alembic.ini](https://github.com/truera/trulens/blob/main/trulens_eval/trulens_eval/database/migrations/alembic.ini)
- [trulens_eval/trulens_eval/tru.py](https://github.com/truera/trulens/blob/main/trulens_eval/trulens_eval/tru.py)

<!-- Dosu Comment Footer -->
<details>
<summary>

#### About Dosu
</summary>

This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.
</details>


Getting the same error!

Getting the same error using 0.28.0, but back to 0.27.2 is work!

~~Thanks for the report. I'm having trouble replicating with the listed versions. Can you post the entirety of `python --version` and `pip list`?~~

Nevermind. I can replicate it on a fresh env.

Hi again. I found one issue which might be the problem here. A patch release 0.28.1 is up. Please update trulens_eval and let me know if the issue is fixed.

Hi @piotrm0 , just tested with the patch release and that has fixed the issue for me, thanks!