Fixing buggy Python when updating

Hi people.

I’ve been facing a small issue when updating 3DEC (v7.00.148 and later).
After 3DEC reinstall, the iPython kernel would systematically crash on start, raising:

ERROR:ipykernel.inprocess.ipkernel:Invalid Message
Traceback (most recent call last):
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\ipykernel\", line 206, in dispatch_shell
    msg = self.session.deserialize(msg, content=True, copy=False)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\jupyter_client\", line 927, in deserialize
    message['header'] = extract_dates(header)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\jupyter_client\", line 67, in extract_dates
    new_obj[k] = extract_dates(v)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\jupyter_client\", line 72, in extract_dates
    obj = parse_date(obj)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\jupyter_client\", line 58, in parse_date
    dt = _dateutil_parse(s)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\dateutil\parser\", line 1368, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\dateutil\parser\", line 654, in parse
    ret = self._build_tzaware(ret, res, tzinfos)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\dateutil\parser\", line 1195, in _build_tzaware
    aware = naive.replace(tzinfo=tz.UTC)
AttributeError: module '' has no attribute 'UTC'
Traceback (most recent call last):
  File "<string>", line 217, in <module>
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\qtconsole\", line 43, in start_channels
    super(QtKernelClientMixin, self).start_channels(*args, **kw)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\ipykernel\inprocess\", line 64, in start_channels
    super(InProcessKernelClient, self).start_channels()
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\jupyter_client\", line 102, in start_channels
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\ipykernel\inprocess\", line 137, in kernel_info
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\ipykernel\inprocess\", line 172, in _dispatch_to_kernel
    idents, reply_msg = self.session.recv(stream, copy=False)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\jupyter_client\", line 803, in recv
    msg_list = socket.recv_multipart(mode, copy=copy)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\site-packages\ipykernel\inprocess\", line 57, in recv_multipart
    return self.queue.get_nowait()
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\", line 192, in get_nowait
    return self.get(block=False)
  File "C:\Program Files\Itasca\3DEC700\exe64\python36\lib\", line 161, in get
    raise Empty

I don’t know if someone else struggled with this, but I figured I would share the (very simple) solution: reinstalling dateutil.
The steps are:

  • start a console: windows+r hotkey then cmd (admin rights will be required)
  • in the console, move to 3DEC Python subfolder : cd C:\Program Files\Itasca\3DEC700\exe64\python36
  • uninstall dateutil TWICE:
> python -m pip uninstall python-dateutil
Uninstalling python-dateutil-2.8.2:
Successfully uninstalled python-dateutil-2.8.2
> python -m pip uninstall python-dateutil
Uninstalling python-dateutil-2.6.1:
Successfully uninstalled python-dateutil-2.6.1
  • reinstall:
> python -m pip install python-dateutil
Collecting python-dateutil
Installing collected packages: python-dateutil
Successfully installed python-dateutil-2.8.2

This solution might be trivial for regular Python users, but might also be of help for some others :slight_smile: !

See you,


1 Like

Thanks Theophile !
You can also try to upgrade python-dateutil instead of un-installing and then re-installing.



I can’t remember if I tried updating but you’re right, it is worth trying a python -m pip install python-dateutil --upgrade first!