Operational Error
(1) By anonymous on 2022-08-27 01:41:22 [source]
Hello, I get the error message: "Operational Error: unable to open database file" and I'm using jupyter notebook and sqlite 3.38.2 on macOS.
The command I run is: db = sqlite3.connect(PATH+"filename.db")
There is nothing wrong with the path or the db file because it worked on my other computer.
Can you please offer suggestions on ways to fix this problem?
Thank you,
(2) By Larry Brasfield (larrybr) on 2022-08-27 04:53:41 in reply to 1 [link] [source]
Here is one way:
Step 0. Delete from your thinking any preconceived ideas as the what the source of your problem is or is not unless you have unimpeachable evidence and solid, logical reasoning from that evidence to support your idea(s). For example, "There is nothing wrong with the path or the db file."
Step 1. On the computer where you have the difficulty, use a print statement or a debugger to see what the expression, PATH+"filename.db" resolves to. Call the character sequence "step 1 result".
Step 2. On that same computer, in a Bash shell, run the command, "file <step 1 result>", where the argument to the file command is what you got in step 1.
Step 3. Read the output of the file command carefully. Most likely it will show why step 0 is appropriate.
(3) By anonymous on 2022-08-27 16:47:32 in reply to 2 [link] [source]
Thank you so much Larry, you helped me solve my problem in less than a minute.
I also appreciate Step 0, and I will keep it in mind from now on.
(4) By Chris Locke (chrisjlocke1) on 2022-08-27 17:28:16 in reply to 3 [link] [source]
Mugs are available from every good IT store. ;)