TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. 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

on my (almost) freshly installed Mac with MacTex my TexShop cannot run the *mk scripts because of this error:

"env: perl: No such file or directory "

This is obviously a configuration issue with TexShop and perl (and shouldn't be to hard) but I can't seem to figure it out.

What's wrong?

share|improve this question
up vote 2 down vote accepted

TeXShop is not involved in this. The latexmk script starts with the shebang line

#!/usr/bin/env perl

that tells the operating system to use Perl for interpreting the script. The error message says that no perl executable is found. Since TeXShop only prepends /usr/texbin to the PATH environment variable, this means either that your PATH variable is malformed or that no perl executable is installed on your system (which is dubious, as Mac OS X has it by default).

You should check what's the answer to the command

echo $PATH

issued to the Terminal.

share|improve this answer
Thank you, that my well be true since I fiddled with the PATH recently. Tomorrow I'll try to fix it, then approve your answer / comment again. – albifant Mar 16 '12 at 16:17
@albifant The standard version of Perl is in /usr/bin. – egreg Mar 16 '12 at 16:20
This is correct. Your answer made it clear to me that my $PATH was corrupted. Thanks, it kept messing with a lot of things lately. For the fun of it, take a look at this: apple.stackexchange.com/questions/44055/delete-things-from-path – albifant Mar 17 '12 at 17:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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