Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Using Databases in Python Our Diary App Doing Data Entry

peewee.DatabaseError: file is encrypted or is not a database

I get this output when I run my code on my local computer:

Traceback (most recent call last):
  File "diary.py", line 39, in <module>
    db.create_tables([Entry], safe=True)
  File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 3855, in create_tables
    create_model_tables(models, fail_silently=safe)
  File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 5294, in create_model_tables
    m.create_table(**create_table_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 4966, in create_table
    if fail_silently and cls.table_exists():
  File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 4962, in table_exists
    return cls._meta.db_table in cls._meta.database.get_tables(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 4012, in get_tables
    'type = ? ORDER BY name;', ('table',))
  File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 3775, in execute_sql
    self.commit()
  File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 3598, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 3768, in execute_sql
    cursor.execute(sql, params or ())
peewee.DatabaseError: file is encrypted or is not a database

I compared the code that I did in this script to the student one that we did in the previous stage and that didn't cause such problems