I am getting the following
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/me/.virtualenvs/demo/lib/python3.4/site-packages/IPython /__init__.py", line 48, in <module>
from .core.application import Application
File "/home/me/.virtualenvs/demo/lib/python3.4/site-packages/IPython /core/application.py", line 40, in <module>
from IPython.core import release, crashhandler
File "/home/me/.virtualenvs/demo/lib/python3.4/site-packages/IPython /core/crashhandler.py", line 28, in <module>
from IPython.core import ultratb
File "/home/me/.virtualenvs/demo/lib/python3.4/site-packages/IPython/core/ultratb.py", line 110, in <module>
from IPython.core import debugger
File "/home/me/.virtualenvs/demo/lib/python3.4/site-packages/IPython/core/debugger.py", line 59, in <module>
from pdb import Pdb as OldPdb
File "/usr/local/lib/python3.4/pdb.py", line 135, in <module>
class Pdb(bdb.Bdb, cmd.Cmd):
AttributeError: 'module' object has no attribute 'Cmd'
2015-01-14 22:23:36.895 [NotebookApp] WARNING | KernelRestarter: restart failed
2015-01-14 22:23:36.896 [NotebookApp] WARNING | Kernel 1005e1cf-b1b4-4f9d- af22-e65c310cfa51 died, removing from map.
ERROR:root:kernel 1005e1cf-b1b4-4f9d-af22-e65c310cfa51 restarted failed!
The last lines of your traceback show that CPython's module
pdb is being imported while IPython starts up. Line 72 of the pdb.py source shows that another module called
cmd is imported by "pdb.py".
The Python docs show the following order when searching for imports, which I believe is the same for IPython:
Since the startup process involves an import of a module called
cmd and there is a file called "cmd.py" in the first place the interpreter looks, it attempts to import that file, which of course doesn't have the things it's looking for. Specifically, your file "cmd.py" doesn't have the Cmd class, so the
AttributeError is raised.
Removing or renaming "cmd.py" in your current working directory will resolve the issue.