Skip to content

Setting up mkdocs-material with latest github version

Find the tag of the latest version on, e.g., 7.1.5, and make a shallow clone (arbitrarily under a directory ~/github in this example).

% git clone --branch 7.1.5 --depth 1

Enter that directory

% cd ~/github/mkdocs-material

Setup local environment directory (abitrarily named .venv here).

% python3 -m venv .venv

Activate it

% source .venv/bin/activate

and the prompt will change


Use pip to install the necessary python modules

(.venv)% pip3 install -r requirements.txt

You'll probably get some error messages but do it again and it will tell everything is OK.

Build it

(.venv)% python3 build

Decide what root to install under. Arbitrarily, this example uses /mnt/common.

Add to your ~/.bashrc the following -

export PYTHONPATH=/mnt/common/lib/python3.8/site-packages:$PYTHONPATH
export PATH=/mnt/common/bin:$PATH

(Note: Modifiying .bashrc should not be necessary if the root is /)

Then of course

(.venv)% source ~/.bashrc

Then execute install.

(.venv)% python3  install --prefix /mnt/common

If an error occurs repeat the same command and it should work the second time.

Close the terminal to exit the (.venv) python environment.

The directory ~/github/mkdocs-material is no loger required.

rm -Rf ~/github/mkdocs-material

Suppose you have a mkdocs-material site in the directory ~/github/mysite. Then

% cd ~/github/mysite
% mkdocs serve

should work correctly.