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‘
126 0
No module factory available for dependency type: ModuleHotAcceptDependency
No module factory available for dependency type: ModuleHotAcceptDependency
344 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,
366 0
Can‘t get attribute ‘SiLU‘ on <module ‘torch.nn.modules.activation‘
Can‘t get attribute ‘SiLU‘ on <module ‘torch.nn.modules.activation‘
|
前端开发
Module理解及使用
Module理解及使用
140 0
|
Python
Could not import the lzma module
Could not import the lzma module
387 0

热门文章

最新文章

下一篇
开通oss服务