'Unable To run mkdocs - theme with the same name

I installed a theme and after doing so, when I run and mkdocs command from the command line, I get the following error:

Traceback (most recent call last):
  File "/usr/local/bin/mkdocs", line 5, in <module>
    from mkdocs.__main__ import cli
  File "/usr/local/lib/python2.7/site-packages/mkdocs/__main__.py", line 78, in <module>
    theme_choices = utils.get_theme_names()
  File "/usr/local/lib/python2.7/site-packages/mkdocs/utils/__init__.py", line 413, in get_theme_names
    return get_themes().keys()
  File "/usr/local/lib/python2.7/site-packages/mkdocs/utils/__init__.py", line 397, in get_themes
    "with the same name".format(theme.name, theme.dist.key))
mkdocs.exceptions.ConfigurationError: The theme readthedocs is a builtin theme but -kdocs provides a theme with the same name

I am running on mac with: Python: 2.7.15 PIP: 20.0.2

Any suggestions as to how to resolve this error would be greatly appreciated.



Solution 1:[1]

The error message on the last line explains the issue:

mkdocs.exceptions.ConfigurationError: The theme readthedocs is a builtin theme but -kdocs provides a theme with the same name

MkDocs includes a builtin theme named readthedocs. And builtin theme names are reserved. However, MkDocs has detected that another package has registered a theme with the same reserved name to the mkdocs.themes group. Apparently, that package is named -kdocs, which is weird because python packages wouldn't normally begin with a hyphen (-).

In any event, the solution is to delete the package with the illegal theme name. If you have recently installed any third party themes, try uninstalling them one by one until the error stops occurring with the command pip uninstall packagename where packagename is the name of the package to be uninstalled. For a list of all installed packages, you can use pip freeze.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Waylan