Luiz Alberto
Luiz Alberto

Reputation: 29

Jupyter notebook and anaconda

I installed Jupyter in Ubuntu, and I use Anaconda. When I try to open a new empty ipython notebook, I get the error 'NameError: global name 'datetime' is not defined'. I transcribe below the complete error message:

[IPKernelApp] ERROR | Invalid Message
Traceback (most recent call last):
  File "/home/luiz/anaconda/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 175, in dispatch_shell
    msg = self.session.deserialize(msg, content=True, copy=False)
  File "/home/luiz/anaconda/lib/python2.7/site-packages/jupyter_client/session.py", line 870, in deserialize
    return adapt(message)
  File "/home/luiz/anaconda/lib/python2.7/site-packages/jupyter_client/adapter.py", line 386, in adapt
    header['date'] = datetime.now().isoformat()
NameError: global name 'datetime' is not defined
[IPKernelApp] ERROR | Invalid Message
Traceback (most recent call last):
  File "/home/luiz/anaconda/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 175, in dispatch_shell
    msg = self.session.deserialize(msg, content=True, copy=False)
  File "/home/luiz/anaconda/lib/python2.7/site-packages/jupyter_client/session.py", line 870, in deserialize
    return adapt(message)
  File "/home/luiz/anaconda/lib/python2.7/site-packages/jupyter_client/adapter.py", line 386, in adapt
    header['date'] = datetime.now().isoformat()
NameError: global name 'datetime' is not defined

What am I missing?

Upvotes: 1

Views: 521

Answers (1)

Luiz Alberto
Luiz Alberto

Reputation: 29

Oops, I needed to update some iPython dependencies. Problem solved!

Thanks!

Upvotes: 1

Related Questions