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

Database possibly not being initialized on Windows #41

Closed
goodmami opened this issue Nov 6, 2020 · 1 comment
Closed

Database possibly not being initialized on Windows #41

goodmami opened this issue Nov 6, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@goodmami
Copy link
Owner

goodmami commented Nov 6, 2020

It has been reported that Wn does not seem to initialize the database if the file is missing. See below:

>>> import wn
>>> for lexicon in wn.lexicons():
...     print (lexicon.id, lexicon.version, lexicon.label)

Running the above code without having a database led to the following error (username redacted):

  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python39\lib\site-packages\wn\_db.py", line 109, in _connect
    conn = sqlite3.connect(dbpath)
sqlite3.OperationalError: unable to open database file

I am unable to reproduce this on Linux, but there might be some kind of permissions issue that prevents the database from being created.

@goodmami goodmami added the bug Something isn't working label Nov 6, 2020
@goodmami
Copy link
Owner Author

goodmami commented Nov 7, 2020

Turns out it's not a Windows thing. The problem is performing database operations (like wn.lexicons()) before the .wn_data directory is created. Executing a wn.download() creates the directory, then all is well.

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

1 participant