ModuleNotFoundError: No module named '_lzma'

装完环境运行项目报错
    import lzma
  File "/usr/local/python3/lib/python3.6/lzma.py", line 27, in <module>
    from _lzma import *
ModuleNotFoundError: No module named '_lzma'
依次执行
yum install xz-devel
yum install python-backports-lzma
pip install backports.lzma
在我的环境中 修改 '/usr/local/python3/lib/python3.6/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
posted @ 2020-08-14 09:31  仰望丶那一缕微光  阅读(9033)  评论(0编辑  收藏  举报