Skip to content

Mkdocs

Macports and Python

Macports installs python as needed. It accumulates versions of python without uninstalling old versions. It is good to uninstall the old versions and reinstall each broken package linked to the old version of python, like bind9. Especially bind9.

PIP will also install python modules, but they should be install AFTER macports not before because Macports may show conflict errors with PIP installed modules. Force installation and activation of Macports python modules, then reinstall PIP modules.

Install PIP

PIP installs python modules that may be used by Macports. To avoid confusion you may need to reinstall PIP modules to fix any problems.

sudo port install py39-pip

Installation of mkdocs

sudo port install python39
sudo port install py39-pip
sudo port select --set python pip39
sudo port select --set python3 pip39
sudo port select --set pip pip39
sudo port select --set pip3 pip39
pip install --upgrade pip

Uninstall mkdocs

sudo -H pip uninstall mkdocs
sudo -H pip uninstall mkdocs-material
sudo -H pip uninstall markdown-include

Install mkdocs

pip install mkdocs
pip install mkdocs-material
pip install markdown-include
pip install mike

Updating pip moduled

pip install --upgrade mkdocs
pip install --upgrade mkdocs-material

Reinstall all pip modules

pip freeze > modules.txt
pip install --upgrade --no-deps --force-reinstall -r modules.txt

Link mkdocs to the binary so you don’t need PATH

sudo ln -s -f /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/mkdocs /opt/local/bin/mkdocs

PIP freeze list contains all modules and dependent modules. Install mkdocs and theme first, then check list.

Upgrade them all - remove any URL references

pip freeze > installed.in
pico installed.in
cat installed.in | sed 's/==/>=/' >installed.out
pip install -r installed.out --upgrade

Troubleshooting

https://stackoverflow.com/questions/65808972/defaulting-to-user-installation-because-normal-site-packages-is-not-writeable

pip install -U --ignore-installed python-openstackclient