pyenv python =3.7.0
pandas = 1.3.2
OS = Ubuntu 16.04
sudo apt-get install libbz2-dev
sudo apt-get install lzma
sudo apt-get install liblzma-dev # 最重要的 编译了好几次 没有这个真不行。很老的包了 2012年的
pip install backports.lzma
find / -name lzma.py
/root/.pyenv/versions/3.7.3/lib/python3.7/lzma.py
try:
from _lzma import *
from _lzma import _encode_filter_properties, _decode_filter_properties
except ImportError:
from backports.lzma import *
from backports.lzma import _encode_filter_properties, _decode_filter_properties
Python 安装pandas库出现Could not import the lzma module
原文:https://www.cnblogs.com/gaodp/p/15270116.html