conda -v 引发错误:子进程。CalledProcessError:命令“lsb_release -a”返回非零退出状态 1

conda -v raised error: subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1

提问人:stevezkw 提问时间:11/9/2023 更新时间:11/9/2023 访问量:17

问:

我使用快速命令行安装中的步骤在我的 ubuntu 上安装了最新的 miniconda

conda -h有效,但引发错误conda -v

(base) kw@intern-Precision-Tower-3420:~$ conda -v
WARNING conda.exception_handler:print_unexpected_error_report(168): KeyError('pkgs_dirs')
Traceback (most recent call last):
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 17, in __call__
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/cli/main.py", line 78, in main_subshell
    exit_code = do_call(args, parser)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/cli/conda_argparse.py", line 160, in do_call
    relative_mod, func_name = args.func.rsplit(".", 1)
                              ^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'func'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 165, in print_unexpected_error_report
    get_main_info_str(error_report["conda_info"])
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/cli/main_info.py", line 254, in get_main_info_str
    info_dict[f"_{key}"] = ("\n" + 26 * " ").join(map(str, info_dict[key]))
                                                           ~~~~~~~~~^^^^^
KeyError: 'pkgs_dirs'

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/cli/main.py", line 78, in main_subshell
        exit_code = do_call(args, parser)
                    ^^^^^^^^^^^^^^^^^^^^^
      File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/cli/conda_argparse.py", line 160, in do_call
        relative_mod, func_name = args.func.rsplit(".", 1)
                                  ^^^^^^^^^
    AttributeError: 'Namespace' object has no attribute 'func'

`$ /home/kw/miniconda3/bin/conda -v`

  environment variables:
conda info could not be constructed.
KeyError('pkgs_dirs')

An unexpected error has occurred. Conda has prepared the above report.
If you suspect this error is being caused by a malfunctioning plugin,
consider using the --no-plugins option to turn off plugins.

Example: conda --no-plugins install <package>

Alternatively, you can set the CONDA_NO_PLUGINS environment variable on
the command line to run the command without plugins enabled.

Example: CONDA_NO_PLUGINS=true conda install <package>

Traceback (most recent call last):
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 17, in __call__
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/cli/main.py", line 78, in main_subshell
    exit_code = do_call(args, parser)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/cli/conda_argparse.py", line 160, in do_call
    relative_mod, func_name = args.func.rsplit(".", 1)
                              ^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'func'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kw/miniconda3/bin/conda", line 13, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/cli/main.py", line 123, in main
    return conda_exception_handler(main, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 388, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 20, in __call__
    return self.handle_exception(exc_val, exc_tb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 75, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 89, in handle_unexpected_exception
    self._upload(error_report)
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 270, in _upload
    self._execute_upload(error_report)
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 303, in _execute_upload
    "User-Agent": self.user_agent,
                  ^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 40, in user_agent
    return context.user_agent
           ^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/auxlib/decorators.py", line 173, in new_fget
    cache[inner_attname] = func(self)
                           ^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/base/context.py", line 1009, in user_agent
    builder.append("%s/%s" % self.os_distribution_name_version)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/auxlib/decorators.py", line 173, in new_fget
    cache[inner_attname] = func(self)
                           ^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/base/context.py", line 1080, in os_distribution_name_version
    from conda._vendor.distro import id, version
  File "/home/kewenzhu/miniconda3/lib/python3.11/site-packages/conda/_vendor/distro.py", line 1080, in <module>
    _distro = LinuxDistribution()
              ^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/_vendor/distro.py", line 595, in __init__
    self._lsb_release_info = self._get_lsb_release_info() \
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kw/miniconda3/lib/python3.11/site-packages/conda/_vendor/distro.py", line 939, in _get_lsb_release_info
    raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.

如果有人能提供一些解决方案,将不胜感激,谢谢

Linux conda miniconda

评论


答: 暂无答案