catalpa-bungei 发表于 2023-9-13 20:58:25

远程服务器的conda无法使用

Traceback (most recent call last):
File "/root/miniconda3/lib/python3.10/site-packages/conda/exception_handler.py", line 17, in __call__
    return func(*args, **kwargs)
File "/root/miniconda3/lib/python3.10/site-packages/conda/cli/main.py", line 54, in main_subshell
    parser = generate_parser(add_help=True)
File "/root/miniconda3/lib/python3.10/site-packages/conda/cli/conda_argparse.py", line 115, in generate_parser
    configure_parser_create(sub_parsers)
File "/root/miniconda3/lib/python3.10/site-packages/conda/cli/conda_argparse.py", line 767, in configure_parser_create
    add_parser_solver(solver_mode_options)
File "/root/miniconda3/lib/python3.10/site-packages/conda/cli/conda_argparse.py", line 1975, in add_parser_solver
    solver.name for solver in context.plugin_manager.get_hook_results("solvers")
File "/root/miniconda3/lib/python3.10/site-packages/conda/base/context.py", line 492, in plugin_manager
    from ..plugins.manager import get_plugin_manager
File "/root/miniconda3/lib/python3.10/site-packages/conda/plugins/__init__.py", line 28, in <module>
    from .hookspec import hookimpl# noqa: F401
File "/root/miniconda3/lib/python3.10/site-packages/conda/plugins/hookspec.py", line 16, in <module>
    from .types import (
File "/root/miniconda3/lib/python3.10/site-packages/conda/plugins/types.py", line 15, in <module>
    from ..core.solve import Solver
File "/root/miniconda3/lib/python3.10/site-packages/conda/core/solve.py", line 30, in <module>
    from ..exceptions import (
File "/root/miniconda3/lib/python3.10/site-packages/conda/exceptions.py", line 16, in <module>
    from requests.exceptions import JSONDecodeError
ImportError: cannot import name 'JSONDecodeError' from 'requests.exceptions' (/root/miniconda3/lib/python3.10/site-packages/requests/exceptions.py)

isdkz 发表于 2023-9-13 20:58:29

这个错误是因为requests库的版本过低导致的。JSONDecodeError是requests库中的一个异常类,它在较早的版本中不存在。解决方法是升级requests库。

可以使用以下命令升级requests库:

pip install --upgrade requests


如果你正在使用conda环境,可以使用以下命令升级requests库:

conda update requests


升级完成后,再次尝试运行程序,应该就可以正常使用了。
页: [1]
查看完整版本: 远程服务器的conda无法使用