ipython: OperationalError: disk I/O error

2019-07-21 02:10发布

问题:

I was running ipython successfully on fedora 18 until now: I'm getting the following exception when trying to launch it:

Traceback (most recent call last):
  File "/usr/bin/ipython", line 9, in <module>
    load_entry_point('ipython==1.1.0', 'console_scripts', 'ipython')()
  File "/usr/lib/python2.7/site-packages/IPython/__init__.py", line 118, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 544, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 89, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 323, in initialize
    self.init_shell()
  File "/usr/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 339, in init_shell
    ipython_dir=self.ipython_dir, user_ns=self.user_ns)
  File "/usr/lib/python2.7/site-packages/IPython/config/configurable.py", line 349, in instance
    inst = cls(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py", line 320, in __init__
    **kwargs
  File "/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 456, in __init__
    self.init_history()
  File "/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 1487, in init_history
    self.history_manager = HistoryManager(shell=self, parent=self)
  File "/usr/lib/python2.7/site-packages/IPython/core/history.py", line 481, in __init__
    self.new_session()
  File "<string>", line 2, in new_session
  File "/usr/lib/python2.7/site-packages/IPython/core/history.py", line 65, in needs_sqlite
    return f(self, *a, **kw)
  File "/usr/lib/python2.7/site-packages/IPython/core/history.py", line 500, in new_session
    self.session_number = cur.lastrowid
OperationalError: disk I/O error

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True

I tried to upgrade ipython to the latest version using pip, which did not help. Any solution or workaround is very much welcomed.

回答1:

IPython store history in a profile generally in ~/.ipython/profile_default/history.sqlite. There seem to be a disk error reading/writting to it. Check the permissions of the file/folders, if necessary delete the file.



回答2:

I solved it by set c.NotebookNotary.db_file = u':memory:' in jupyter configure file ~/.jupyter/jupyter_notebook_config.py



标签: ipython