Why is fsspec an optional dependency, when you need it to read a csv file with pandas?

I use the pandas package quite a bit, so I’ve made it globally available on my main work computer. I did this quite awhile ago, so I can’t recall all the details to what I did when installing in the past, but I don’t remember having to take an extra step in installing the optional dependency, fsspec.

I recently tried to get a little work done at home, and I had to pip install pandas again on another computer, and I was surprised to see that reading from a local csv file failed because fsspec was considered an optional dependency.

What’s the reasoning behind making it optional instead of automatically installing it as a required dependency?

edit: It turns out I just fat-fingered the path and put c:// instead of c:/. I’m assuming the extra slash set a flag to recognize the rest of the path as a remote file?

>Solution :

As mentioned in the docs:

All URLs which are not local files or HTTP(s) are handled by fsspec,
if installed, and its various filesystem implementations (including
Amazon S3, Google Cloud, SSH, FTP, webHDFS…).

As to why is optional – it’s developer’s decision, but I would expect that as it is not required if you don’t work with remote files, you don’t need it, so they decided t leave it optional.

Leave a Reply