fralau / mkdocs-macros-plugin

Create richer and more beautiful pages in MkDocs, by using variables and calls to macros in the markdown code.
https://mkdocs-macros-plugin.readthedocs.io
Other
321 stars 50 forks source link

Error: The "macros" plugin is not installed #148

Closed SilentGlasses closed 1 year ago

SilentGlasses commented 1 year ago

I read over Issue #12 but that is not what is creating an issue for me...

I RTFM as per instructions in the Where Can I get Help? section and went through the install instructions twice but it still gives me the error.

Installation

The plugin

pip3 install install mkdocs-macros-plugin
Collecting install
  Downloading install-1.3.5-py3-none-any.whl (3.2 kB)

[...]

Installing collected packages: install
Successfully installed install-1.3.5

Edit config.yml

plugins:
  - search
  - macros

Testing

mkdocs serve
INFO     -  Building documentation...
ERROR    -  Config value: 'plugins'. Error: The "macros" plugin is not installed
Aborted with 1 Configuration Errors!

Troubleshooting

Verify plugin is installed

Interestingly, pip list shows this mkdocs-macros-plugin 0.7.0 but the actual current version shows it at only v0.5.0 released on Nov 23, 2020 ... not sure if this is correct but I found it 😮.

pip list
Package                                   Version
----------------------------------------- -----------
Babel                                     2.10.3
beautifulsoup4                            4.11.1
certifi                                   2022.6.15
charset-normalizer                        2.1.0
click                                     8.1.3
csscompressor                             0.9.5
EditorConfig                              0.12.3
ghp-import                                2.1.0
gitdb                                     4.0.9
GitPython                                 3.1.27
htmlmin                                   0.1.12
idna                                      3.3
importlib-metadata                        4.12.0
install                                   1.3.5
Jinja2                                    3.1.2
jsbeautifier                              1.14.4
jsmin                                     3.0.1
livereload                                2.6.3
lunr                                      0.6.2
Markdown                                  3.3.7
markdown-include                          0.6.0
MarkupSafe                                2.1.1
mercurial                                 6.1.4
mergedeep                                 1.3.4
mkdocs                                    1.3.1
mkdocs-autolinks-plugin                   0.6.0
mkdocs-git-authors-plugin                 0.6.4
mkdocs-git-revision-date-localized-plugin 1.1.0
mkdocs-macros-plugin                      0.7.0
mkdocs-material                           8.3.9
mkdocs-material-extensions                1.0.3
mkdocs-mermaid2-plugin                    0.6.0
mkdocs-minify-plugin                      0.5.0
packaging                                 21.3
pip                                       22.3.1
pycurl                                    7.45.1
Pygments                                  2.12.0
pymdown-extensions                        9.5
pyparsing                                 3.0.9
python-dateutil                           2.8.2
pytz                                      2022.1
PyYAML                                    6.0
pyyaml_env_tag                            0.1
requests                                  2.28.1
setuptools                                65.4.1
six                                       1.16.0
smmap                                     5.0.0
soupsieve                                 2.3.2.post1
tabulate                                  0.8.10
termcolor                                 2.1.0
tornado                                   6.2
urllib3                                   1.26.11
watchdog                                  2.1.9
zipp                                      3.8.1

debugging

I did run mkdocs serve --verbose but can't share the output as this is a company site but there was noting standing out other that the error message...

mkdocs serve --verbose
INFO     -  Building documentation...
DEBUG    -  Loading configuration file: /path/to/docs/site/mkdocs.yml
ERROR    -  Config value: 'plugins'. Error: The "macros" plugin is not installed
DEBUG    -  Config value: 'config_file_path' = '/path/to/docs/site/mkdocs.yml'

[...]

DEBUG    -  Config value: 'markdown_extensions' = ['toc', 'tables', 'fenced_code', 'abbr', 'admonition', 'attr_list', 'codehilite', 'def_list', 'footnotes',
            'md_in_html', 'meta', 'pymdownx.arithmatex', 'pymdownx.betterem', 'pymdownx.caret', 'pymdownx.critic', 'pymdownx.details', 'pymdownx.emoji',
            'pymdownx.highlight', 'pymdownx.inlinehilite', 'pymdownx.keys', 'pymdownx.magiclink', 'pymdownx.mark', 'pymdownx.pathconverter',
            'pymdownx.saneheaders', 'pymdownx.smartsymbols', 'pymdownx.snippets', 'pymdownx.superfences', 'pymdownx.tabbed', 'pymdownx.tasklist',
            'pymdownx.tilde']
DEBUG    -  Config value: 'mdx_configs' = None
DEBUG    -  Config value: 'strict' = False
DEBUG    -  Config value: 'remote_branch' = 'gh-pages'
DEBUG    -  Config value: 'remote_name' = 'origin'
DEBUG    -  Config value: 'extra' = {'key': {'version': 0.29}}
DEBUG    -  Config value: 'plugins' = ['search', 'macros', {'minify': {'minify_html': True, 'minify_css': True}}, 'autolinks', {'git-authors': {'exclude':
            ['index.md', 'tags.md']}}, {'git-revision-date-localized': {'type': 'timeago', 'locale': 'en', 'fallback_to_build_date': True, 'exclude':
            ['index.md', 'tags.md']}}, {'tags': {'tags_file': 'tags.md'}}]
DEBUG    -  Config value: 'watch' = None
Aborted with 1 Configuration Errors!

Not sure what else to ry or provide, please let me know if more information is needed.

github-actions[bot] commented 1 year ago

Welcome to this project and thank you!' first issue

SilentGlasses commented 1 year ago

I even ran the installer again just to make sure...

pip install mkdocs-macros-plugin
Requirement already satisfied: mkdocs-macros-plugin in /path/to/site/lib/python3.10/site-packages (0.7.0)
Requirement already satisfied: mkdocs>=0.17 in /path/to/site/lib/python3.10/site-packages (from mkdocs-macros-plugin) (1.4.2)
Requirement already satisfied: termcolor in /path/to/site/lib/python3.10/site-packages (from mkdocs-macros-plugin) (2.1.0)
Requirement already satisfied: jinja2 in /path/to/site/lib/python3.10/site-packages (from mkdocs-macros-plugin) (3.1.2)
Requirement already satisfied: python-dateutil in /path/to/site/lib/python3.10/site-packages (from mkdocs-macros-plugin) (2.8.2)
Requirement already satisfied: pyyaml in /path/to/site/lib/python3.10/site-packages (from mkdocs-macros-plugin) (6.0)
Requirement already satisfied: click>=7.0 in /path/to/site/lib/python3.10/site-packages (from mkdocs>=0.17->mkdocs-macros-plugin) (8.1.3)
Requirement already satisfied: watchdog>=2.0 in /path/to/site/lib/python3.10/site-packages (from mkdocs>=0.17->mkdocs-macros-plugin) (2.1.9)
Requirement already satisfied: mergedeep>=1.3.4 in /path/to/site/lib/python3.10/site-packages (from mkdocs>=0.17->mkdocs-macros-plugin) (1.3.4)
Requirement already satisfied: packaging>=20.5 in /path/to/site/lib/python3.10/site-packages (from mkdocs>=0.17->mkdocs-macros-plugin) (21.3)
Requirement already satisfied: markdown<3.4,>=3.2.1 in /path/to/site/lib/python3.10/site-packages (from mkdocs>=0.17->mkdocs-macros-plugin) (3.3.7)
Requirement already satisfied: ghp-import>=1.0 in /path/to/site/lib/python3.10/site-packages (from mkdocs>=0.17->mkdocs-macros-plugin) (2.1.0)
Requirement already satisfied: pyyaml-env-tag>=0.1 in /path/to/site/lib/python3.10/site-packages (from mkdocs>=0.17->mkdocs-macros-plugin) (0.1)
Requirement already satisfied: MarkupSafe>=2.0 in /path/to/site/lib/python3.10/site-packages (from jinja2->mkdocs-macros-plugin) (2.1.1)
Requirement already satisfied: six>=1.5 in /path/to/site/lib/python3.10/site-packages (from python-dateutil->mkdocs-macros-plugin) (1.16.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /path/to/site/lib/python3.10/site-packages (from packaging>=20.5->mkdocs>=0.17->mkdocs-macros-plugin) (3.0.9)
fralau commented 1 year ago

This is curiouser and curiouser...

Are you sure you are refering to the same environment? I mean, is the plugin installed in the same environment as the mkdocs you are running?

What if you tried to uninstall both mkdocs and mkdocs-macros and reinstalled them (making sure that they are really, really uninstalled)? At least you would make sure that both are installed in the same place?

SilentGlasses commented 1 year ago

Ha, so interesting... I ensured I was in the same environment when doing all the installs, they all worked except for macros. If I disabled the macros plugin in mkdocs.yml the site functioned normally.

For some weird reason, it seems like pip was randomly forgetting the plugin had been installed so running pip list a second time did not show it as installed. 🤷🏻

What's even weirder was after ensuring I had all the latest versions and generating a new requirements file, it just magically started working as if nothing was ever wrong. 🤯

fralau commented 1 year ago

Thank you! I am glad this is resolved!