您当前的位置: 首页 > 

彭世瑜

暂无认证

  • 1浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Could not import the lzma module

彭世瑜 发布时间:2020-08-05 13:48:04 ,浏览量:1

运行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)
关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.1281s