0

Locally, I've created an empty sqlite database called earthquakes.db. Using the dataset Python library, I am able to freeze my results to a json file and everything works as expected. However, when deployed I get a long list of errors that presumably refer to being unable to connect to the database.

Traceback (most recent call last):
   File "/var/www/html/apps/earthquakes/scripts/earthquakes.py", line 7, in <module>
       db = dataset.connect('sqlite:///earthquakes.db')

   ... More base.py and pool.py errors here ...

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file

I've checked permissions and installs, everything seems to be right. What am I missing? Thx.

Dave
  • 7,555
  • 8
  • 46
  • 88
Layne
  • 642
  • 1
  • 13
  • 32

1 Answers1

0

Noob move. When I gave it the full path in my script, the error went away.

From this... db = dataset.connect('sqlite:///earthquakes.db')

To this... db = dataset.connect('sqlite:////var/www/html/apps/earthquakes/scripts/earthquakes.db')

Layne
  • 642
  • 1
  • 13
  • 32