0

I want to set up a new tinyDB object in Python 3, but TinyDB() gives me this error

Traceback (most recent call last):
  File "C:/Users/Utente/Documents/CodingStuff/AlgManager/AlgManager.py", line 4, in <module>
    db = tdb.TinyDB()
  File "C:\Users\Utente\PycharmProjects\prova\venv\lib\site-packages\tinydb\database.py", line 159, in __init__
    self._storage = storage(*args, **kwargs)
TypeError: __init__() missing 1 required positional argument: 'path'

I guess it's something about installation, because the code I wrote is really only

import tinydb as tdb

db = tdb.TinyDB()

I installed TinyDB with pip. What can I do?

Essay97
  • 648
  • 1
  • 9
  • 24

1 Answers1

4

No matter what python version you use TinyDB has a required parameter "path to db" when you create the instance.

Something like this:

import tinydb as tdb
db = tdb.TinyDB('path/to/db.json')
Moldovan Daniel
  • 1,521
  • 14
  • 23