jupyter / jupyter-drive

Google drive for jupyter notebooks
BSD 2-Clause "Simplified" License
418 stars 78 forks source link

Cannot import cast_unicode_py2 when i try to run python -m Jupyterdrive - Using Python 3.7 #149

Closed cyonghui81 closed 4 years ago

cyonghui81 commented 4 years ago
▶ python -m jupyterdrive            
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/conda/lib/python3.7/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/opt/conda/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/root/jupyter-drive/jupyterdrive/__init__.py", line 18, in <module>
    from IPython.utils.py3compat import cast_unicode_py2
ImportError: cannot import name 'cast_unicode_py2' from 'IPython.utils.py3compat' (/opt/conda/lib/python3.7/site-packages/IPython/utils/py3compat.py)
(base) 
westurner commented 4 years ago

Looks like https://github.com/ipython/ipython/blob/master/IPython/utils/py3compat.py no longer has a cast_unicode_py2

Reading the history for the file: https://github.com/ipython/ipython/commits/master/IPython/utils/py3compat.py

@willingc @Carreau Could we just drop support for Python2 from jupyter-drive? Or do we need to copy this into __init__.py to make this line work https://github.com/jupyter/jupyter-drive/blob/master/jupyterdrive/__init__.py#L82 :

def no_code(x, encoding=None):
    return x

cast_unicode_py2 = no_code
willingc commented 4 years ago

@westurner I'm not sure what support we have for this project anymore. @Carreau @ian-r-rose may have a better idea.

If it is still active, I agree that we should drop Python 2.

Carreau commented 4 years ago

Thanks wes for looking into the history.

I don't believe this project is active anymore as google remove the ability to use RT API.

If someone send a pull-request that fix the code, I think we can merge it, but we likely won't do any more releases.

To avoid user opening issues we should either: 1) Archive this repository, and/or 2) update the readme and issues templates for user to be aware.

There are also likely more recent JupyterLab plugin to work with google drive.

westurner commented 4 years ago

There are also likely more recent JupyterLab plugin to work with google drive.

https://github.com/jupyterlab/jupyterlab-google-drive

westurner commented 4 years ago

IIUC, when Google discontinued the Realtime API, that also nixed the collaborative features in Google Colab.

Carreau commented 4 years ago

Thanks Wes !

Do you want to send a pull request that update the readme to add these informations ?