import pandas results in ModuleNotFoundError :_lzma

Marco Dalla Gasperina picture Marco Dalla Gasperina · Jul 19, 2019 · Viewed 10.7k times · Source

On Ubuntu 18.04 with python 3.7.3, I'm attempting to import pandas but this fails because it can't find _lzma.

I've verified that _lzma is installed with dpkg:

/usr/lib/python3.7/lib-dynload/_lzma.cpython-37m-x86_64-linux-gnu.so. Oddly, _lzma is not a dependency of pandas (as specified by pip3).

Answer

alex s picture alex s · Jul 19, 2019

I was running into this exact same issue today! I was able to fix it though.

Pandas just put out a new version 0.25.0 on July 18th and changing the version back to 0.24.2 fixed this issue for me.

I hope this works for you too!

link: https://pandas.pydata.org/