Search code examples
pythonlzmaxz

extract xz file in python


I have a file data.csv.xz. I want to extract the csv file but not manually. I find a way by using the package lzma. But when I pip install lama in python 3.8 in spyder, I got an error:

ERROR: Could not find a version that satisfies the requirement lzma (from versions: none) ERROR: No matching distribution found for lzma

what's wrong with the version 3.8 ? And, is there any other way to accomplish this task?


Solution

  • lzma is part of the standard library of Python, so you won't find it in the PyPi indices.

    To verify, simply fire up your python shell and just try :

    >>> import lzma
    >>>
    

    It should work.