Skip to content

KaggleHub doesn't unpack zip files on Windows #252

@MichalPuzanov

Description

@MichalPuzanov

Zip issue on Windows

I am using KaggleHub in Python. The issue is that Kagglehub is able to download a particular file from a zip achieve. This works well in Linux, but in Windows, it downloads the whole archive. I believe it is the same functionality as on Linux, but then it tries to unzip the archive and select the file and remove the others. But I'm not sure about it. The issue is unzip is not in Windows. Another possibility is that it doesn't want to unzip the file with a different extension. It expects zip to unzip it, but has for example csv.

The example can be this:

dataset: "datasnaek/youtube-new"
file: "GBvideos.csv"

videos_path = kh.dataset_download(config['kaggle']['videos']['dataset'], path=config['kaggle']['videos']['file'])

On Linux particular CSV file is downloaded to the cache, but on Windows, there is a whole zip archive in the cache.

I know a simple solution would be doesn't use Windows crap :-), but I have to. Is there any way around except of secure it in the code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions