Nick Vandeborg
Nick Vandeborg

Reputation: 21

ModuleNotFoundError: No module named 'markdown' when running lektor server

When running lektor server to deploy and see my website, it reports markdown is absent, while it is installed.

/usr/local/lib/lektor/lib/python3.7/site-packages/watchdog/utils/bricks.py:175: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working

  class OrderedSet(collections.MutableSet):
Traceback (most recent call last):
...

  File "/home/nick/swingrock.be/lektor/packages/tipue-content-file-generator/lektor_tipue_content_file_generator.py", line 7, in <module>
    import markdown

ModuleNotFoundError: No module named 'markdown'

but markdown is installed, you can see the version here

nick@nick-VirtualBox:~/swingrock.be/lektor$ markdown --version

This is Markdown, version 1.0.1.
Copyright 2004 John Gruber
http://daringfireball.net/projects/markdown/

Are there any steps I'm missing?

Upvotes: 2

Views: 12635

Answers (2)

MadMike
MadMike

Reputation: 1439

I've had a similar error. With the curren version Lektor 3.1.3, I needed to downgrade Werkzeug to Version 0.16.

I strongly recommend not to do this with your system-wide installed python environment. Instead you should install a python virtual environment.

This might seem tedious now, but is worth it.

python3 -m venv ~/venv_lektor
~/venv_lektor/bin/pip install lektor
~/venv_lektor/bin/pip install Werkzeug==0.16
~/venv_lektor/bin/lektor --version
~/venv_lektor/bin/lektor quickstart --name "Test-Site"
cd ~/Test-Site/
~/venv_lektor/bin/lektor server

Upvotes: 0

Waylan
Waylan

Reputation: 42497

You appear to have the Perl implementation of Markdown installed. However, your script appears to be expecting the Python implementation and is not finding it as you do not have that implementation installed. You can install it with the following command (be sure to run the command as a user with the necessary permissions):

pip install markdown

Upvotes: 2

Related Questions