Search code examples
pythonpython-3.xmacospipmkdocs

Mkdocs is not found, but possible to uninstall on macOS


My python versions are:

python --version
Python 2.7.9

python3 --version
Python 3.8.5

I have downloaded pip.

pip --version
pip 20.2.2 from /Library/Python/3.8/site-packages/pip (python 3.8)

pip3 --version
pip 20.2.2 from /Library/Python/3.8/site-packages/pip (python 3.8)

I need to download the mkdocs on my Mac. For that I run the command: pip3 install mkdocs. After running this command, I see that:


Successfully installed Jinja2-2.11.2 Markdown-3.2.2 MarkupSafe-1.1.1 PyYAML-5.3.1 click-7.1.2 future-0.18.2 joblib-0.16.0 livereload-2.6.3 lunr-0.5.8 mkdocs-1.1.2 nltk-3.5 regex-2020.7.14 tornado-6.0.4 tqdm-4.48.2

However, after I run the command mkdocs --version, it says zsh: command not found: mkdocs. Whereas after I run pip3 uninstall mkdocs - it shows:

Found existing installation: mkdocs 1.1.2
Uninstalling mkdocs-1.1.2:
  Would remove:
    /Users/...

How do I install mkdocs so that I can run the needed mkdocs serve?


Solution

  • This article helped me a lot: https://jeannot-muller.com/code/mkdocs_on_macos/howto_install_mkdocs_on_macos/

    I needed to also install mkdocs-material and matplotlab and after run mkdocs serve in my project's root folder. The thing was, I had to use pip3 in every command.

    sudo pip3 install mkdocs
    sudo pip3 install mkdocs-material
    sudo pip3 install matplotlib
    

    in rootFolder/

    mkdocs serve