We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9408937 + 2cea256 commit 41efb46Copy full SHA for 41efb46
lib/matplotlib/backends/backend_pgf.py
@@ -6,6 +6,7 @@
6
import math
7
import os
8
import sys
9
+import errno
10
import re
11
import shutil
12
import tempfile
@@ -316,8 +317,14 @@ def __init__(self):
316
317
stdin=subprocess.PIPE,
318
stdout=subprocess.PIPE,
319
cwd=self.tmpdir)
- except OSError:
320
- raise RuntimeError("Error starting process '%s'" % self.texcommand)
+ except OSError as e:
321
+ if e.errno == errno.ENOENT:
322
+ raise RuntimeError("Latex command not found. "
323
+ "Install '%s' or change pgf.texsystem to the desired command."
324
+ % self.texcommand
325
+ )
326
+ else:
327
+ raise RuntimeError("Error starting process '%s'" % self.texcommand)
328
test_input = self.latex_header + latex_end
329
stdout, stderr = latex.communicate(test_input.encode("utf-8"))
330
if latex.returncode != 0:
0 commit comments