This is a known issue: https://github.com/omz/Pythonista-Issues/issues/502

Until omz releases an update to fix this, the only workaround that I know of is to use Python 3 instead of Python 2.