数据库不可访问

import sqlite3
import matplotlib.pyplot as plt
conn = sqlite3.connect("~/Desktop/Personal/database_1.sqlite")
pd.read_sql("SELECT * FROM sqlite_master WHERE type='table';", conn)
OperationalError                          Traceback (most recent call last)
<ipython-input-13-0d5f0352a16d> in <module>
  5 import sqlite3
  6 import matplotlib.pyplot as plt
  ----> 7 conn = sqlite3.connect("~/Desktop/Personal/database_1.sqlite")
  8 pd.read_sql("SELECT * FROM sqlite_master WHERE type='table';", conn)

 OperationalError: unable to open database file

可能是什么问题呢?当我导入Kaggle时,它可以在Kaggle上运行,但在桌面/个人文件上尝试时,则不能。

评论