简体   繁体   中英

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?

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.

lzma is a part of standard library of Python. You dont need to install it, instead you can directly import it.

You can refer this https://docs.python.org/3/library/lzma.html#module-lzma

As said, you won't need to install lzma , as it is already in the pip standard library.

There's absolutely nothing wrong with your Python (hopefully).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM