Ipython: 例外メッセージで「sqlite3.OperationalError:読み取り専用データベースを書き込もうとしました」の処理方法に関する情報を提供します

作成日 2014年01月01日  ·  4コメント  ·  ソース: ipython/ipython

sqlite3.OperationalErrorが発生しています:読み取り専用データベースを書き込もうとしています
(スタックトレースが添付されています)。 これはデータベース接続に関連するエラーのように思われるため、失敗した接続パラメーター(少なくともホストとポート)を指定すると、エラーメッセージがより正確になる可能性があります(これは私の拡張要求です)。 プログラムが何を期待しているのかは明確ではありません。

スタックトレース

sys.excepthookのエラー:
トレースバック(最後の最後の呼び出し):
ファイル "/mnt/DATA/sources/ipython/IPython/core/application.py"、175行目、excepthook
self.crash_handler(etype、evalue、tb)を返します
ファイル "/mnt/DATA/sources/ipython/IPython/core/crashhandler.py"、行158、呼び出し中
traceback = TBhandler.text(etype、evalue、etb、context = 31)
ファイル "/mnt/DATA/sources/ipython/IPython/core/ultratb.py"、412行目、テキスト
tb_offset、コンテキスト)
ファイル "/mnt/DATA/sources/ipython/IPython/core/ultratb.py"、行963、structured_traceback
ipinst = ipapi.get()
ファイル "/mnt/DATA/sources/ipython/IPython/core/ipapi.py"、28行目、get
InteractiveShell.instance()を返します
ファイル "/mnt/DATA/sources/ipython/IPython/config/configurable.py"、行318、インスタンス
inst = cls(_args、 _kwargs)ファイル "/mnt/DATA/sources/ipython/IPython/core/interactiveshell.py"、436行目、 initself.init_history()ファイル "/mnt/DATA/sources/ipython/IPython/core/interactiveshell.py"、1489行目、init_historyself.history_manager = HistoryManager(shell = self、config = self.config)ファイル "/mnt/DATA/sources/ipython/IPython/core/history.py"、行409、 initself.new_session()ファイル ""、2行目、new_sessionファイル "/mnt/DATA/sources/ipython/IPython/core/history.py"、60行目、needs_sqlitef(_a、_を返す kw)
new_sessionのファイル "/mnt/DATA/sources/ipython/IPython/core/history.py"、行427
NULL、 "") "" "、(datetime.datetime.now()、))
sqlite3.OperationalError:読み取り専用データベースを書き込もうとしました

元の例外は次のとおりです。
トレースバック(最後の最後の呼び出し):
ファイル "/ usr / bin / ipython"、7行目、
launch_new_instance()
ファイル "/mnt/DATA/sources/ipython/IPython/frontend/terminal/ipapp.py"、行388、launch_new_instance
app.initialize()
ファイル ""、2行目、初期化中
ファイル "/mnt/DATA/sources/ipython/IPython/config/application.py"、84行目、catch_config_error
return method(app、_args、 _kwargs)ファイル "/mnt/DATA/sources/ipython/IPython/frontend/terminal/ipapp.py"、行324、初期化中self.init_shell()ファイル "/mnt/DATA/sources/ipython/IPython/frontend/terminal/ipapp.py"、行340、init_shellipython_dir = self.ipython_dir)ファイル "/mnt/DATA/sources/ipython/IPython/config/configurable.py"、行318、インスタンスinst = cls(_args、* _kwargs)ファイル "/mnt/DATA/sources/ipython/IPython/frontend/terminal/interactiveshell.py"、行360、 inituser_module = user_module、custom_exceptions = custom_exceptionsファイル "/mnt/DATA/sources/ipython/IPython/core/interactiveshell.py"、436行目、 initself.init_history()ファイル "/mnt/DATA/sources/ipython/IPython/core/interactiveshell.py"、1489行目、init_historyself.history_manager = HistoryManager(shell = self、config = self.config)ファイル "/mnt/DATA/sources/ipython/IPython/core/history.py"、行409、 initself.new_session()ファイル ""、2行目、new_sessionファイル "/mnt/DATA/sources/ipython/IPython/core/history.py"、60行目、needs_sqlitef(_a、_を返す kw)
new_sessionのファイル "/mnt/DATA/sources/ipython/IPython/core/history.py"、行427
NULL、 "") "" "、(datetime.datetime.now()、))
sqlite3.OperationalError:読み取り専用データベースを書き込もうとしました

python -c "import IPython; print(IPython.sys_info())"の出力:

{'commit_hash': '858d539'、
'commit_source': 'インストール'、
'default_encoding': 'UTF-8'、
'ipython_path': '/ usr / local / lib / python2.7 / dist-packages / IPython'、
'ipython_version': '0.13.2'、
'os_name': 'posix'、
'プラットフォーム': 'Linux-3.11.0-14-generic-x86_64-with-Ubuntu-13.10-saucy'、
'sys_executable': '/ usr / bin / python'、
'sys_platform': 'linux2'、
'sys_version': '2.7.5+(デフォルト、2013年9月19日、13:48:49)n [GCC 4.8.1]'}

問題レポートにファイルを添付して、すでにコミットされている問題を検索できるようにすると便利です(!!)。

最も参考になるコメント

私はこれを試しましたが、うまくいきました。 @ takluyver 、@ richtekpに感謝します。

~/.ipython/profile_default/history.sqlite
/Users/ChessTastic/.ipython/profile_default/history.sqlite.
➜  profile_default  sudo chmod a+w history.sqlite
Password:

全てのコメント4件

sqliteはデータベースサーバーではなくファイルを使用します。 デフォルトでは、 ~/.ipython/profile_default/history.sqlite保存されます。 そのファイルは存在し、書き込み可能ですか?

ヒントをありがとう! ファイルの権限が間違っていました(書き込み不可)。 エラーメッセージ/出力を改善することをお勧めします。

問題レポートにファイルを添付できると便利です。

要旨を使用するのが一般的です。

すでにコミットされた問題を検索できるようになります(!!)。

検索フィールドはページの上部にあります。

私はこれを試しましたが、うまくいきました。 @ takluyver 、@ richtekpに感謝します。

~/.ipython/profile_default/history.sqlite
/Users/ChessTastic/.ipython/profile_default/history.sqlite.
➜  profile_default  sudo chmod a+w history.sqlite
Password:
このページは役に立ちましたか?
0 / 5 - 0 評価