Pandas: Problem with lzma module

Created on 29 Aug 2019  Â·  8Comments  Â·  Source: pandas-dev/pandas

/usr/local/lib/python3.7/site-packages/pandas/compat/__init__.py:84: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.

I get this error when I run the code and I don't know how to fix it

Most helpful comment

When you're getting above warning and building Python from source, make sure to

  • Include required packages. Here, install the lzma module sudo apt-get install liblzma-dev
  • Rebuild from source directory configure && make and sudo make install

These steps removed the warning for my Python 3.7.3.
See also this Stack Overflow question

All 8 comments

I already checked the other related issue but they didn't help me, I have debian 9 installed on my server with python 3.7

That's just a warning, not an error.

You'll need to reinstall Python. If you're building from source you need to make sure that the proper headers are in place.

which headers do I need?

I've installed python again but same error

I'm not sure. I suspect the Python docs have some information.

On Thu, Aug 29, 2019 at 9:53 AM Anatras notifications@github.com wrote:

I've installed python again but same error

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pandas-dev/pandas/issues/28219?email_source=notifications&email_token=AAKAOIS7NW3HLWLPZ5T7APDQG7PIPA5CNFSM4ISCNQW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5OYM2I#issuecomment-526222953,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKAOIQN7RLUCD7NCSUX4YLQG7PIPANCNFSM4ISCNQWQ
.

I had this problem recently ... but here, upgrading from Python 3.7.3 to Python 3.7.4 solved the problem!

@Anatras another user mentioned the xz library.

Closing, since this is an issue with the Python install, not pandas.

When you're getting above warning and building Python from source, make sure to

  • Include required packages. Here, install the lzma module sudo apt-get install liblzma-dev
  • Rebuild from source directory configure && make and sudo make install

These steps removed the warning for my Python 3.7.3.
See also this Stack Overflow question

Was this page helpful?
0 / 5 - 0 ratings