tqdm causing problems with Anaconda navigator

76 Views Asked by At

I'm trying to use tqdm in an environment. I first accidentally installed it in base, then installed it in my environment. Two issues.

First, when I open a jupyter notebook in base, I can import tqdm fine. But when I open one in my environment, attempting to import tqdm gives me this error:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[3], line 1
----> 1 import tqdm

ModuleNotFoundError: No module named 'tqdm'

Same error if I try from tqdm import tqdm

Also, when I uninstall tqdm from base, it seems to break everything. Anaconda Navigator won't open and I can't update the navigator or conda. Reinstalling tqdm lets the navigator open, but I still can't update anything. Also, if I uninstall tqdm while the navigator is open, it gets hung up any time it tries to update the packages in base.

After uninstalling tqdm, I tried to update conda. Got this.

(base) C:\Users\Tower>conda update conda
KeyError('pkgs_dirs')
Traceback (most recent call last):
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\exception_handler.py", line 17, in __call__
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\cli\main.py", line 54, in main_subshell
    parser = generate_parser(add_help=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\cli\conda_argparse.py", line 115, in generate_parser
    configure_parser_create(sub_parsers)
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\cli\conda_argparse.py", line 767, in configure_parser_create
    add_parser_solver(solver_mode_options)
  File "C:\Users\Tower\anaconda3\Lib\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 "C:\Users\Tower\anaconda3\Lib\site-packages\conda\base\context.py", line 492, in plugin_manager
    from ..plugins.manager import get_plugin_manager
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\plugins\__init__.py", line 28, in <module>
    from .hookspec import hookimpl  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\plugins\hookspec.py", line 16, in <module>
    from .types import (
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\plugins\types.py", line 15, in <module>
    from ..core.solve import Solver
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\core\solve.py", line 41, in <module>
    from ..resolve import Resolve
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\resolve.py", line 15, in <module>
    from tqdm import tqdm
ModuleNotFoundError: No module named 'tqdm'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\exception_handler.py", line 166, in print_unexpected_error_report
    get_main_info_str(error_report["conda_info"])
  File "C:\Users\Tower\anaconda3\Lib\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 "C:\Users\Tower\anaconda3\Lib\site-packages\conda\exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\cli\main.py", line 54, in main_subshell
        parser = generate_parser(add_help=True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\cli\conda_argparse.py", line 115, in generate_parser
        configure_parser_create(sub_parsers)
      File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\cli\conda_argparse.py", line 767, in configure_parser_create
        add_parser_solver(solver_mode_options)
      File "C:\Users\Tower\anaconda3\Lib\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 "C:\Users\Tower\anaconda3\Lib\site-packages\conda\base\context.py", line 492, in plugin_manager
        from ..plugins.manager import get_plugin_manager
      File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\plugins\__init__.py", line 28, in <module>
        from .hookspec import hookimpl  # noqa: F401
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\plugins\hookspec.py", line 16, in <module>
        from .types import (
      File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\plugins\types.py", line 15, in <module>
        from ..core.solve import Solver
      File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\core\solve.py", line 41, in <module>
        from ..resolve import Resolve
      File "C:\Users\Tower\anaconda3\Lib\site-packages\conda\resolve.py", line 15, in <module>
        from tqdm import tqdm
    ModuleNotFoundError: No module named 'tqdm'

I think this is about the hangup when the navigator was trying to load the list of packages in base. After reinstalling tqdm, I tried to update and got this new error.

Preparing transaction: done
Verifying transaction: failed

RemoveError: 'tqdm' is a dependency of conda and cannot be removed from
conda's operating environment.

Somehow tqdm has become a dependency, which is in turn preventing me from updating. The same thing happens when I try to update the navigator. How do I fix the update issue? And how do I access tqdm in my environment?

0

There are 0 best solutions below