0
import simplejson as json
from tinydb import TinyDB

#파일 DB 생성

db = TinyDB('C:\python\\section5\\databases\\database.db')
#db.default_table_name = 'users'

This is ERROR please help me to solve this problem:

Traceback (most recent call last):

  File "C:\python\section5\5-2-1.py", line 3, in <module>
    from tinydb.storages import MemoryStorage

  File "C:\Users\HSM\anaconda3\envs\section5\lib\site-packages\tinydb\__init__.py", line 29, in <module>
    from .database import TinyDB

  File "C:\Users\HSM\anaconda3\envs\section5\lib\site-packages\tinydb\database.py", line 13
    
TableBase: Type[Table] = with_typehint(Table)
             ^
SyntaxError: invalid syntax
[Finished in 0.078s]
Progman
  • 16,827
  • 6
  • 33
  • 48
  • Please format your code. My guess is some indentation error. – 21rw Jul 13 '21 at 08:02
  • Looks like you're using an old version of Python that doesn't support type annotations (the `TableBase: Type[Table]` syntax) – ForceBru Jul 13 '21 at 11:01

1 Answers1

0

this means you're using old version python,you can do pip install tinydb==3.5.0(lastest version 4.5.0 make error)

xuetuo
  • 11
  • 2