Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create io.datasette.llm in Application Support on install #193

Closed
mikesten opened this issue Aug 28, 2023 · 1 comment
Closed

Create io.datasette.llm in Application Support on install #193

mikesten opened this issue Aug 28, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mikesten
Copy link

mikesten commented Aug 28, 2023

Small on here... I think you need to create the io.datasette.llm directory on install (or check before logging).

I've tried installing llm via brew and pip, and both get this error from the sqlite logging after successfully running a command:

$ llm 'hello world'
Hello! How can I assist you today?
Traceback (most recent call last):
  File "/Users/mikestenhouse/.asdf/installs/python/3.11.4/bin/llm", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/mikestenhouse/.asdf/installs/python/3.11.4/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestenhouse/.asdf/installs/python/3.11.4/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/mikestenhouse/.asdf/installs/python/3.11.4/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestenhouse/.asdf/installs/python/3.11.4/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestenhouse/.asdf/installs/python/3.11.4/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestenhouse/.asdf/installs/python/3.11.4/lib/python3.11/site-packages/llm/cli.py", line 266, in prompt
    db = sqlite_utils.Database(log_path)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mikestenhouse/.asdf/installs/python/3.11.4/lib/python3.11/site-packages/sqlite_utils/db.py", line 339, in __init__
    self.conn = sqlite3.connect(str(filename_or_conn))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: unable to open database file

I create io.datasette.llm myself manually and everything's fine:

~/Library/Application Support $ mkdir io.datasette.llm
~/Library/Application Support $ llm 'hello world'
Hello! How can I assist you today?

Some versions:
llm 0.8
Python 3.11.4
Homebrew 4.1.6
macOS 13.5.1

👋🏻

@simonw simonw added the bug Something isn't working label Sep 1, 2023
@simonw
Copy link
Owner

simonw commented Sep 1, 2023

Hah yeah this is a bug - that folder is meant to be created automatically but clearly there's a case where it isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants