IPython中%store持久化数据的数据库文件系统位置查询
Storemagic 存储数据库的文件系统位置
IPython的storemagic扩展使用的SQLite数据库文件默认存放在IPython配置目录的profile子目录下,具体路径分操作系统:
- Linux/macOS:
~/.ipython/profile_default/db/store.sqlite - Windows:
%USERPROFILE%\.ipython\profile_default\db\store.sqlite(也可能是C:\Users\<你的用户名>\AppData\Roaming\ipython\profile_default\db\store.sqlite,取决于系统配置)
如果你的IPython使用了自定义profile,只需把路径里的profile_default替换为对应的profile名称即可。
另外,你可以在IPython会话里执行以下命令快速定位当前profile的数据库目录:
!ipython locate profile default
执行后会返回profile的根目录,加上/db/store.sqlite就是数据库文件的完整路径。
内容的提问来源于stack exchange,提问作者RubenLaguna
相关产品推荐
相关产品推荐

