Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter Notebook Anaconda cannot open because of syntax error with dateutil

I'm trying to open Jupyter Notebook with Anaconda navigator (on Mac OSX) and I cannot open it properly. I keep getting this message in my terminal.

File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.py", line 158
    l.append("%s=%s" % (attr, `value`))
                              ^
SyntaxError: invalid syntax
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

I tried checking my default version of python and it says my default version is python 3.6. However when I got to pip and try to install dateutil it says

pip install python-dateutil
Requirement already satisfied: python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python

I am having trouble since I have multiple versions of python on my computer. What can I do?

like image 864
A. N. Avatar asked Jan 29 '23 10:01

A. N.


1 Answers

I was having the same problem with anconda 4.5.1 python 3.6. Reinstalling the package solved the problem for me.

pip uninstall python-dateutil
pip install python-dateutil
like image 172
Gaurav Avatar answered Feb 03 '23 08:02

Gaurav