No module named ‘_lzma’

简介: No module named ‘_lzma’

import librosa

import lzma

上面两个操作都会引起这个错误:

ModuleNotFoundError: No module named ‘_lzma’


解决过程如下:


第一步:去lzma官网查看ubuntu环境下如何安装lzma

lzma官网安装教程

(1)sudo apt-get install liblzma-dev

(2)pip install backports.lzma

如果和我一样是python 3.6,第二个操作换换成:

pip3 install backports.lzma (可能需要sudo)

第二步:修改原本就存在的lmza.py文件

把 /usr/local/lib/python3.6/lzma.py line 27行

修改如下:

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



目录
相关文章
No module named ‘win32file‘
No module named ‘win32file‘
45644 0
ModuleNotFoundError: No module named ‘mmdet.version‘
ModuleNotFoundError: No module named ‘mmdet.version‘
1552 0
|
6月前
|
Python
【Python】已解决ModuleNotFoundError: No module named ‘requests’
【Python】已解决ModuleNotFoundError: No module named ‘requests’
3443 2
|
8月前
|
Python Windows
ImportError: No module named ‘encodings’
ImportError: No module named ‘encodings’
557 0
|
6月前
|
数据挖掘 程序员 Python
【Python】已解决:ModuleNotFoundError: No module named ‘Workbook’
【Python】已解决:ModuleNotFoundError: No module named ‘Workbook’
110 0
pip安装skbuild报错:ModuleNotFoundError: No module named ‘skbuild’解决方法
pip安装skbuild报错:ModuleNotFoundError: No module named ‘skbuild’解决方法,换源
777 0
|
TensorFlow 算法框架/工具 计算机视觉
No module named ‘cv2‘ 解决办法 (No module named ‘numpy‘ 等所有报错均可解决)
No module named ‘cv2‘ 解决办法 (No module named ‘numpy‘ 等所有报错均可解决)
|
Python
ModuleNotFoundError: No module named ‘Image‘
ModuleNotFoundError: No module named ‘Image‘
397 0
ModuleNotFoundError: No module named ‘Image‘
|
关系型数据库 MySQL Python
三十九、ModuleNotFoundError: No module named ‘MySQLdb‘(已解决)
三十九、ModuleNotFoundError: No module named ‘MySQLdb‘(已解决)
三十九、ModuleNotFoundError: No module named ‘MySQLdb‘(已解决)

热门文章

最新文章