File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 44
55from ..spec import AbstractFileSystem
66from ..utils import infer_storage_options
7- from .http import HTTPFileSystem
87from .memory import MemoryFile
98
109# TODO: add GIST backend, would be very similar
@@ -64,7 +63,7 @@ def __init__(
6463
6564 self .root = sha
6665 self .ls ("" )
67- self .http_fs = HTTPFileSystem ( ** kwargs )
66+ self .kwargs = kwargs
6867
6968 @property
7069 def kw (self ):
@@ -247,7 +246,14 @@ def _open(
247246 # we land here if the content was not present in the first response
248247 # (regular file over 1MB or git-lfs tracked file)
249248 # in this case, we get let the HTTPFileSystem handle the download
250- return self .http_fs .open (
249+ try :
250+ from .http import HTTPFileSystem
251+ except ImportError as e :
252+ raise ImportError (
253+ "Please install fsspec[http] to acccess github files >1 MB "
254+ "or git-lfs tracked files."
255+ ) from e
256+ return HTTPFileSystem (** self .kwargs ).open (
251257 content_json ["download_url" ],
252258 mode = mode ,
253259 block_size = block_size ,
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ full = [
5656fuse = [" fusepy" ]
5757gcs = [" gcsfs" ]
5858git = [" pygit2" ]
59- github = [" fsspec[http] " , " requests" ]
59+ github = [" requests" ]
6060gs = [" gcsfs" ]
6161gui = [" panel" ]
6262hdfs = [" pyarrow >= 1" ]
You can’t perform that action at this time.
0 commit comments