4

I installed the anaconda version of python, and changed the PATH to allow python command to work in terminal.

However when I type ipython, I get the following error.

Traceback (most recent call last):
  File "/Users/mrbighit/anaconda/bin/ipython", line 6, in <module>
    sys.exit(start_ipython())
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 563, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 92, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 332, in initialize
    self.init_shell()
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 348, in init_shell
    ipython_dir=self.ipython_dir, user_ns=self.user_ns)
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/config/configurable.py", line 354, in instance
    inst = cls(*args, **kwargs)
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/terminal/interactiveshell.py", line 328, in __init__
    **kwargs
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 465, in __init__
    self.init_history()
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 1521, in init_history
    self.history_manager = HistoryManager(shell=self, parent=self)
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/core/history.py", line 498, in __init__
    self.new_session()
  File "<string>", line 2, in new_session
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/core/history.py", line 68, in needs_sqlite
    return f(self, *a, **kw)
  File "/Users/mrbighit/anaconda/lib/python2.7/site-packages/IPython/core/history.py", line 516, in new_session
    NULL, "") """, (datetime.datetime.now(),))
OperationalError: attempt to write a readonly database

Opening the ipython qtconsole also give kernel errors. I've made sure I have the right conda list packages.

3
  • just to check does sudo ipython work? Commented Aug 3, 2014 at 3:29
  • I believe you sudo installed Anaconda into your home directory, which is why you are having these problems. You can safely get rid of the /Users/mrbighit/anaconda directory and install Anaconda as your normal user. Commented Aug 3, 2014 at 11:44
  • I used the bash command to install Anaconda, I didn't specify the install directory, just followed the site instructions. I didn't use the sudo install. Should I do the graphical installation and install it into a different directory? Commented Aug 3, 2014 at 12:23

2 Answers 2

2

Look for a .config/ipython/history.sqlite file on your system and change ownership with:

sudo chown ..., root somehow owns the file which is why you are seeing the error.

Sign up to request clarification or add additional context in comments.

4 Comments

Could you kindly explain how to change ownership in the terminal commands? I'm very new to mac.
have you found the history.sqlite file? It may also be in somewhere like .ipython/profile_default
I used the 'find /Users/mrbighit -name "history.sqlite"' command, then I used the 'sudo chown -v'.. and it worked.
Yes, find is very handy, I wonder how it happened it the first place?
0

Open a normal python REPL, run:

from IPython.utils.path import locate_profile
locate_profile('default')

Check that you have the write permission on the folder

1 Comment

/Users/mrbighit/.ipython/profile_default' is the location and I was able to see that the folder has write permission. I tried sudo ipython and ipython loads without a problem, but using just ipython I get the error meessage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.