Cannot generate (markdown) content after Pelican upgrade/reinstall
nicokosi opened this issue · 4 comments
- I have searched the issues (including closed ones) and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Issue
Hello, 👋
I use pelican
since 2016 to generate my blog. I have recently re-installed it after a two-year break and I cannot generate markdown content anymore. 😭
I have installed Pelican via pipx
:
pipx install "pelican[markdown]"
Here is an extract from DEBUG logs when running Pelican to generate content:
pipx run pelican content --ignore-cache --delete-output-directory --debug
⚠️ pelican is already on your PATH and installed at /usr/local/bin/pelican. Downloading and running anyway.
[07:02:17] DEBUG Pelican version: 4.9.1 __init__.py:627
DEBUG Python version: 3.12.3 __init__.py:628
DEBUG Adding current directory to system path __init__.py:71
DEBUG Finding namespace plugins _utils.py:97
DEBUG Found generator: ArticlesGenerator (internal) __init__.py:229
DEBUG Found generator: PagesGenerator (internal) __init__.py:229
DEBUG Found generator: StaticGenerator (internal) __init__.py:229
DEBUG Missing dependencies for md, markdown, mkd, mdown
... ✂️
Done: Processed 0 articles, 0 drafts, 0 hidden articles, 0 pages, 0 hidden pages and 0 draft pages in 0.46 seconds.
Note that there are 27 markdown articles in the content
folder:
ls content/*.md | wc -l
27
head -10 content/devoxx-fr-2024-fr.md
Title: Mon Devoxx France 2024
Date: 2024-04-22 08:10
Tags: conference devoxx
Slug: devoxx-fr-2024
Author: Nicolas Kosinski
Summary: Mon résumé de la conférence Devoxx France 2024.
Lang: fr
# Mon Devoxx France 2024
Here is my pelican configuration code.
Do you have any advices? Thanks in advance! 🤗
PS:
- I have read the documentation and searched issues.
- I have also tried the sample configuration from https://github.com/getpelican/pelican/blob/0b5934a1fa56bb7ca9b0b0011e35f9043afc6ce9/CONTRIBUTING.rst#how-to-get-help but it did not help:
$ pipx run pelican content -s ~/projects/pelican/samples/pelican.conf.py -t ~/projects/pelican/pelican/themes/notmyidea
⚠️ pelican is already on your PATH and installed at /Users/nicolas/.local/bin/pelican. Downloading and running anyway.
[07:21:32] CRITICAL TemplateNotFound: pages/jinja2_template.html
Seems related to #1868 (but I don't think its similar since I have installed the markdown
dependency).
$ pipx list
venvs are in /Users/nicolas/.local/pipx/venvs
apps are exposed on your $PATH at /Users/nicolas/.local/bin
manual pages are exposed at /Users/nicolas/.local/share/man
package markdown 3.6, installed using Python 3.12.3
- markdown_py
package pelican 4.9.1, installed using Python 3.12.3
- pelican
- pelican-import
- pelican-plugins
- pelican-quickstart
- pelican-themes
package virtualenv 20.25.3, installed using Python 3.12.3
- virtualenv
Hi Nicholas. I don't think this has anything to do with the pre-existing issue to which you linked. Rather, I believe the answer is right there in the output:
⚠️ pelican is already on your PATH and installed at /usr/local/bin/pelican. Downloading and running anyway.
pipx run […]
is for downloading and running packages in an ad-hoc and temporary manner, so it is intentionally ignoring any other pelican
executables on $PATH
, including the installation you performed via pipx install "pelican[markdown]"
, and is instead performing its intended function and re-downloading Pelican into a temporary virtual environment — without Markdown, since you didn't specify it in your pipx run […]
invocation.
Presumably your goal is to use the non-temporary environment, which you should be able to confirm works just fine by executing it explicitly:
/Users/nicolas/.local/bin/pelican content --ignore-cache --delete-output-directory --debug
I say "explicitly" because it seems you have another (older?) Pelican installation at /usr/local/bin/pelican
. If desired, you can run which pelican
to see which installation is taking precedence and then adjust your $PATH
to ensure /Users/nicolas/.local/bin
takes precedence over /usr/local/bin
.
Alternatively, in the (unlikely?) event you actually do want to run Pelican in a temporary and ad-hoc manner, include the missing Markdown
dependency in the specifier:
pipx run "pelican[markdown]" content --ignore-cache --delete-output-directory
Thank you @justinmayer, I did not undestand what I was doing with pipx
! 😇
I will have a try on the laptop I use for generating my blog (not the one I am currently using).
I close this issue.
PS: it worked like a charm using Python 3 on my macOs laptop. 😊
python3 -m pip install "pelican[markdown]"