Could not import the lzma module

简介: Could not import the lzma module

运行Python程序,出现警告


UserWarning: Could not import the lzma module. Your installed Python is incomplete.

Attempting to use lzma compression will result in a RuntimeError.

warnings.warn(msg)

打开警告,将warnings注释掉,就不会每次出现警告了

def _import_lzma():
    """
    Importing the `lzma` module.
    Warns
    -----
    When the `lzma` module is not available.
    """
    try:
        import lzma
        return lzma
    except ImportError:
        msg = (
            "Could not import the lzma module. "
            "Your installed Python is incomplete. "
            "Attempting to use lzma compression will result in a RuntimeError."
        )
        # warnings.warn(msg)
相关文章
|
8月前
export 与 import | ES6
export 与 import | ES6
41 0
export 与 import | ES6
|
8月前
|
JavaScript 前端开发
ES6之Module:export、import
ES6之Module:export、import
from pymdownx import superfences No module named ‘pymdownx‘
from pymdownx import superfences No module named ‘pymdownx‘
121 0
No module factory available for dependency type: ModuleHotAcceptDependency
No module factory available for dependency type: ModuleHotAcceptDependency
338 0
|
3月前
bisec module 应用
bisec module 应用
17 0
|
7月前
|
Python
【已解决】ModuleNotFoundError: No module named ‘DBUtils‘,from DBUtils.PooledDB import PooledDB,
【已解决】ModuleNotFoundError: No module named ‘DBUtils‘,from DBUtils.PooledDB import PooledDB,
344 0
|
前端开发
Module理解及使用
Module理解及使用
139 0
|
JavaScript 小程序 前端开发
(区别、详解、使用)module.exports与exports,export与export default,import 与require
变量的导出涉及到四个关键字module.exports与exports,export与export default, 其中module.exports与exports是符合CommonJS模块规范的。
414 0
(区别、详解、使用)module.exports与exports,export与export default,import 与require
|
Python
ModuleNotFoundError: No module named 'utils'
ModuleNotFoundError: No module named 'utils'
1207 0