"I am experiencing an error and it's causing difficulties."

I tried using QIIME 2 2023.2, but I encountered the following error. The error appears not only when I run "conda activate ~", but even when I simply type "conda". I found that some users who encountered similar errors were able to resolve the issue by reinstalling Miniconda, but this did not work for me. Could you please help me?

conda config --set debug true
conda update conda

KeyError('active_prefix_name')
Traceback (most recent call last):
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/exception_handler.py", line 18, in __call__
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/cli/main.py", line 52, in main_subshell
    from .conda_argparse import do_call, generate_parser, generate_pre_parser
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/cli/conda_argparse.py", line 51, in <module>
    from .main_create import configure_parser as configure_parser_create
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/cli/main_create.py", line 16, in <module>
    from ..notices import notices
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/notices/__init__.py", line 3, in <module>
    from .core import notices  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/notices/core.py", line 15, in <module>
    from . import cache, fetch, views
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/notices/fetch.py", line 11, in <module>
    import requests
  File "/opt/miniconda3/lib/python3.12/site-packages/requests/__init__.py", line 164, in <module>
    from .api import delete, get, head, options, patch, post, put, request
  File "/opt/miniconda3/lib/python3.12/site-packages/requests/api.py", line 11, in <module>
    from . import sessions
  File "/opt/miniconda3/lib/python3.12/site-packages/requests/sessions.py", line 15, in <module>
    from .adapters import HTTPAdapter
  File "/opt/miniconda3/lib/python3.12/site-packages/requests/adapters.py", line 76, in <module>
    _preloaded_ssl_context = create_urllib3_context()
                             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 252, in create_urllib3_context
    raise TypeError("Can't create an SSLContext object without an ssl module")
TypeError: Can't create an SSLContext object without an ssl module

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/exception_handler.py", line 165, in print_unexpected_error_report
    get_main_info_str(error_report["conda_info"])
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/cli/main_info.py", line 393, in get_main_info_str
    return "\n".join(("", *(f"{key:>23} : {value}" for key, value in builder()), ""))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/cli/main_info.py", line 393, in <genexpr>
    return "\n".join(("", *(f"{key:>23} : {value}" for key, value in builder()), ""))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/lib/python3.12/site-packages/conda/cli/main_info.py", line 353, in builder
    if info_dict["active_prefix_name"]:
       ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'active_prefix_name'

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

    Traceback (most recent call last):
      File "/opt/miniconda3/lib/python3.12/site-packages/conda/exception_handler.py", line 18, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/opt/miniconda3/lib/python3.12/site-packages/conda/cli/main.py", line 52, in main_subshell
        from .conda_argparse import do_call, generate_parser, generate_pre_parser
      File "/opt/miniconda3/lib/python3.12/site-packages/conda/cli/conda_argparse.py", line 51, in <module>
        from .main_create import configure_parser as configure_parser_create
      File "/opt/miniconda3/lib/python3.12/site-packages/conda/cli/main_create.py", line 16, in <module>
        from ..notices import notices
      File "/opt/miniconda3/lib/python3.12/site-packages/conda/notices/__init__.py", line 3, in <module>
        from .core import notices  # noqa: F401
        ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/miniconda3/lib/python3.12/site-packages/conda/notices/core.py", line 15, in <module>
        from . import cache, fetch, views
      File "/opt/miniconda3/lib/python3.12/site-packages/conda/notices/fetch.py", line 11, in <module>
        import requests
      File "/opt/miniconda3/lib/python3.12/site-packages/requests/__init__.py", line 164, in <module>
        from .api import delete, get, head, options, patch, post, put, request
      File "/opt/miniconda3/lib/python3.12/site-packages/requests/api.py", line 11, in <module>
        from . import sessions
      File "/opt/miniconda3/lib/python3.12/site-packages/requests/sessions.py", line 15, in <module>
        from .adapters import HTTPAdapter
      File "/opt/miniconda3/lib/python3.12/site-packages/requests/adapters.py", line 76, in <module>
        _preloaded_ssl_context = create_urllib3_context()
                                 ^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/miniconda3/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 252, in create_urllib3_context
        raise TypeError("Can't create an SSLContext object without an ssl module")
    TypeError: Can't create an SSLContext object without an ssl module

`$ /opt/miniconda3/bin/conda config --set debug true`

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

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>

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers? [y/N]:

Hello @takahitokawaguchi, what operating system are you using? MacOS, Linux, WSL?

hank you for your reply.I use macOS with an M2 chip.

I'm having difficulty finding references to the issue you're having. You may have better luck posting about this on the conda support forums. I don't think it has anything specifically to do with QIIME 2, and I'm not sure what's causing it.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.