'Python sqlite3.OperationalError: unable to open database file

I am trying to create a Database on my PC using python and SQLite 3 using the code below, however when I attempt to run I get this error

conn = sqlite3.connect('test_database')
sqlite3.OperationalError: unable to open database file

I'm quite new to this, so sorry if this is a simple mistake. Could someone tell me how i can fix this?

import sqlite3


conn = sqlite3.connect('test_database') 
c = conn.cursor()
c.execute('''
          CREATE TABLE IF NOT EXISTS bot_memory
          ([id] INTEGER PRIMARY KEY, [dateandtime] datetime, [task] varchar, [result] varchar)
          ''')
          
conn.commit()
conn.close()


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source