To use py26-markdown installed by MacPorts

0

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?

Léo Léopold Hertz 준영

Posted 2009-07-23T23:25:32.253

Reputation: 4 828

Answers

2

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.

quark

Posted 2009-07-23T23:25:32.253

Reputation: 868

1

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.

jtbandes

Posted 2009-07-23T23:25:32.253

Reputation: 8 350