I installed the following Markdown-to-HTML converter by MacPorts.

py26-markdown @2.0 (python, textproc)
    Python implementation of Markdown

I run

py26-markdown 1.markdown

I get

zsh: command not found: py26-markdown

How can you use py26-markdown?


py26-markdown is not the program's name, it's the name of the package. The program is markdown.py and it comes from that package. It's a module you use by importing it into Python, or by running it from the command line. Using it from the command-line is explained in the user's guide. It looks like this:

<python> markdown.py input_file.txt > output_file.html

You may need to explicitly call it from Python depending on whether it is executable by default or not.

To find out where the actual script lives you should ask port:

port contents py26-markdown | grep markdown.py

markdown.py doesn't necessarily need to be on your PATH, but it will be a lot easier to use it lives in your PYTHONPATH, which should include /opt/local/lib/python2.6/site-packages.


It's possible that your $PATH variable wasn't set properly, or was only set for bash. Make sure it contains /opt/local/bin:/opt/local/sbin and that $MANPATH contains /opt/local/share/man.

Edit: Actually, wait, is py26-markdown even supposed to be a command? This page suggests it may be something you use from within Python.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.