zoukankan      html  css  js  c++  java
  • 新安装的pip3,使用出现No module named 'lsb_release'的问题

    报错:

    Exception:
    Traceback (most recent call last):
      File "/usr/local/python3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
        status = self.run(options, args)
      File "/usr/local/python3/lib/python3.6/site-packages/pip/commands/install.py", line 272, in run
        with self._build_session(options) as session:
      File "/usr/local/python3/lib/python3.6/site-packages/pip/basecommand.py", line 72, in _build_session
        insecure_hosts=options.trusted_hosts,
      File "/usr/local/python3/lib/python3.6/site-packages/pip/download.py", line 329, in __init__
        self.headers["User-Agent"] = user_agent()
      File "/usr/local/python3/lib/python3.6/site-packages/pip/download.py", line 93, in user_agent
        from pip._vendor import distro
      File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 1050, in <module>
        _distro = LinuxDistribution()
      File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 594, in __init__
        if include_lsb else {}
      File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 931, in _get_lsb_release_info
        raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
    subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.
    Traceback (most recent call last):
      File "/usr/local/bin/pip3", line 11, in <module>
        sys.exit(main())
      File "/usr/local/python3/lib/python3.6/site-packages/pip/__init__.py", line 248, in main
        return command.main(cmd_args)
      File "/usr/local/python3/lib/python3.6/site-packages/pip/basecommand.py", line 251, in main
        timeout=min(5, options.timeout)) as session:
      File "/usr/local/python3/lib/python3.6/site-packages/pip/basecommand.py", line 72, in _build_session
        insecure_hosts=options.trusted_hosts,
      File "/usr/local/python3/lib/python3.6/site-packages/pip/download.py", line 329, in __init__
        self.headers["User-Agent"] = user_agent()
      File "/usr/local/python3/lib/python3.6/site-packages/pip/download.py", line 93, in user_agent
        from pip._vendor import distro
      File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 1050, in <module>
        _distro = LinuxDistribution()
      File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 594, in __init__
        if include_lsb else {}
      File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 931, in _get_lsb_release_info
        raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
    subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.
    $ lsb_release -a   # 使用命令查看报错详情
    Traceback (most recent call last):
      File "/usr/bin/lsb_release", line 25, in <module>    # 这个路径很重要
        import lsb_release
    ModuleNotFoundError: No module named 'lsb_release'
    
    # 将系统完整的lsb_release.py文件拷贝到报错的目录文件下即可
    sudo cp /usr/lib/python3/dist-packages/lsb_release.py /usr/bin/
  • 相关阅读:
    good excel website
    MSVCR90D.dll
    oracle db
    check socket status
    数据库数据恢复
    Nginx+Keepalived实现站点高可用[z]
    个人永久性免费-Excel催化剂功能第58波-批量生成单选复选框
    个人永久性免费-Excel催化剂功能第57波-一键生成完全组合的笛卡尔积结果表
    个人永久性免费-Excel催化剂功能第56波-获取Excel对象属性相关自定义函数
    个人永久性免费-Excel催化剂功能第55波-Excel批注相关的批量删除作者、提取所有批注信息等
  • 原文地址:https://www.cnblogs.com/presleyren/p/13518799.html
Copyright © 2011-2022 走看看