Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed docutils on my Mac OS system following the docutils instructions.

I've also done:

$ sudo cp tools/ tools/ /usr/local/bin

However, if I open a command line and type rst2html, I get 'command not found'.

If I type, there's no problem, so the Python file itself is on my path.

How do I get my system to recognize rst2html as a valid command?


share|improve this question
up vote 2 down vote accepted

I don't know about mac, but generally in a Unix system the file extension isn't implied. Indeed a file name extension rarely has any special meaning at all. However there are lot of Unix tricks to help you, perhaps creating a symbolic link:

$ sudo ln -s /usr/local/bin/rst2html
share|improve this answer
Thank you... :) – AP257 Mar 16 '11 at 14:55

When you type the command rst2html on the command line, it's going to look for a program called rst2html (not rst2html.somethingorother) in the directories in your PATH. If you want rst2html to work, you need a file named rst2html. There are several ways to do this:

  1. Rename the program. There's no actual need for the .py extension, as the system knows it's a Python script because of its shebang line.

    sudo mv /usr/local/bin/ /usr/local/bin/rst2html
  2. Hard-link the program. You can have the program listed in /usr/local/bin under two different names, and rst2html, and either one can be used to launch it.

    sudo ln /usr/local/bin/ /usr/local/bin/rst2html
  3. Symbolic-link the program. Similar to hard-linking, except that only one is the "real" file, the other is just a unix-style alias. This may be a bit easier to manage than hard-linking, because if you ever install an updated version, the link will automatically use the new version (while with a hard link, you'd need to update the link manually).

    sudo ln -s /usr/local/bin/rst2html

Personally, I'd just rename it (option 1), but either of the other options should work fine as well.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .