Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example script gives error #27

Open
richardblythman opened this issue Dec 28, 2021 · 4 comments
Open

Example script gives error #27

richardblythman opened this issue Dec 28, 2021 · 4 comments

Comments

@richardblythman
Copy link

I installed gdrivefs using pip. When I run your example script (in example_w_xarray_zarr.ipynb):

import gdrivefs
# use this the first time you run
token = 'browser'
# use this on subsequent attempts
#token = 'cache'

# shareable link to folder generated with
# https://drive.google.com/open?id=1FQzXM2E28WF6fV7vy1K7HdxNV-w6z_Wx
root_file_id = '1FQzXM2E28WF6fV7vy1K7HdxNV-w6z_Wx'

gdfs = gdrivefs.GoogleDriveFileSystem(token=token, root_file_id=root_file_id)
gdfs

I get the following error:
AttributeError: module 'gdrivefs' has no attribute 'GoogleDriveFileSystem'

@martindurant
Copy link
Member

It is right here in the package init. Perhaps you have another file called "gdrivefs.py" or "gdrivefs/" on your path that python is picking up?

@richardblythman
Copy link
Author

richardblythman commented Jan 3, 2022

I installed with pip, not from source. And nope, no issues with path.

The __init__.py that's downloaded with pip only has one line:
__version__ = '0.14.13'

@martindurant
Copy link
Member

I see. So it seems there is a name conflict: this gdrivefs has never been released on PyPI (or elsewhere), you can only install it directly

pip install git+https://github.com/fsspec/gdrivefs

or by cloning the repo by hand. I suppose in your case you would need to uninstall the other gdrivefs, which is something else, a CLI and FUSE layer.

I was not at all aware of the other project, we could probably merge the code here into theirs, especially since they appear to have solved the auth situation in a robust way.

cc @dsoprea

@richardblythman
Copy link
Author

Ah, didn't spot that. OK this explains it. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants