Python3中import pandas后提示错误
问题
import pandas
后提示:Warning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
warnings.warn(msg)
解决:
1 | sudo apt install liblzma-dev |
修改/usr/local/lib/python3.10/lzma.py
第27行,改成如下内容:1
2
3
4
5
6try:
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
相关文章