(Windows 10) Unable to use Anaconda Prompt - AttributeError: module 'colorama' has no attribute 'init'

Viewed 382

When I open Anaconda, I am unable to do anything. When I type a command, I end up getting:

Traceback (most recent call last):
  File "C:\Users\jenni\Anaconda3\Scripts\conda-script.py", line 12, in <module>
    sys.exit(main())
  File "C:\Users\jenni\Anaconda3\lib\site-packages\conda\cli\main.py", line 145, in main
    init_loggers()
  File "C:\Users\jenni\Anaconda3\lib\site-packages\conda\cli\main.py", line 56, in init_loggers
    from ..gateways.logging import initialize_logging, set_verbosity
  File "C:\Users\jenni\Anaconda3\lib\site-packages\conda\gateways\logging.py", line 14, in <module>
    from ..common.io import attach_stderr_handler
  File "C:\Users\jenni\Anaconda3\lib\site-packages\conda\common\io.py", line 33, in <module>
    from .._vendor.tqdm import tqdm
  File "C:\Users\jenni\Anaconda3\lib\site-packages\conda\_vendor\tqdm\__init__.py", line 8, in <module>
    from ._tqdm import tqdm
  File "C:\Users\jenni\Anaconda3\lib\site-packages\conda\_vendor\tqdm\_tqdm.py", line 13, in <module>
    from ._utils import _supports_unicode, _environ_cols_wrapper, _range, _unich, \
  File "C:\Users\jenni\Anaconda3\lib\site-packages\conda\_vendor\tqdm\_utils.py", line 31, in <module>
    colorama.init()
AttributeError: module 'colorama' has no attribute 'init'

I've tried uninstalling/reinstalling colorama, but I can't do so without Anaconda. Has anyone encountered this issue before? I've only seen one specific instance on here and it involves uninstalling.

1 Answers

I ran into this problem after uninstalling/re-installing Python & Anaconda.

From the miniconda troubleshooting page:

This can be caused by an old version of requests or by having the PYTHONPATH environment variable set.

Solution

Update requests and be sure PYTHONPATH is not set:

  1. Run conda info -a to show the requests version and various environment variables such as PYTHONPATH.
  2. Update the requests version with pip install -U requests.
  3. Clear PYTHONPATH:
    • On Windows, clear it the environment variable settings.
    • On macOS and Linux, clear it by removing it from the bash profile and restarting the shell.
Related