Bonjour à toutes et à tous,

Je suis entrain de m'initier à Python et au PyX.
Je recontre le pb suivant:

Voici les quelques lignes suivantes :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
#---début---
from pyx import *
 
g = graph.graphxy(width=8, x=graph.axis.linear(min=-15, max=15))
g.plot(graph.data.function("y(x)=sin(x)/x"))
g.writeEPSfile("function")
g.writePDFfile("function")
g.writeSVGfile("function")
#--- fin---
Malheureusement, Python proteste et me répond :
manifestement c'est la commande "graph.data.function" qui semble poser pb.

--début message d'erreur

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Running script: "/Users/draper/Documents/2016-2017/PYTHON/pyx test.py"
Traceback (most recent call last):
  File "/Users/draper/Documents/2016-2017/PYTHON/pyx test.py", line 5, in <module>
    g.writeEPSfile("function")
  File "/usr/local/lib/python3.6/site-packages/pyx/canvas.py", line 50, in wrappedindocument
    return method(d, file, **write_kwargs)
  File "/usr/local/lib/python3.6/site-packages/pyx/document.py", line 185, in writeEPSfile
    pswriter.EPSwriter(self, f, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pyx/pswriter.py", line 142, in __init__
    page.processPS(pagefile, self, acontext, registry, pagebbox)
  File "/usr/local/lib/python3.6/site-packages/pyx/document.py", line 132, in processPS
    self._process("processPS", *args)
  File "/usr/local/lib/python3.6/site-packages/pyx/document.py", line 78, in _process
    bbox.set(self.canvas.bbox()) # this bbox is not accurate
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/graph.py", line 181, in bbox
    self.finish()
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/graph.py", line 303, in finish
    self.doaxes()
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/graph.py", line 580, in doaxes
    self.dolayout()
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/graph.py", line 564, in dolayout
    self.doaxiscreate(axisname)
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/graph.py", line 240, in doaxiscreate
    self.axes[axisname].create()
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/axis/axis.py", line 591, in create
    self.canvas = self.axis.create(self.data, self.positioner, self.graphtexrunner, self.errorname)
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/axis/axis.py", line 250, in create
    return _regularaxis._create(self, data, positioner, graphtexrunner, self.parter, self.rater, errorname)
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/axis/axis.py", line 220, in _create
    variants[0].storedcanvas = layout(variants[0])
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/axis/axis.py", line 141, in layout
    self.painter.paint(canvas, data, self, positioner)
  File "/usr/local/lib/python3.6/site-packages/pyx/graph/axis/painter.py", line 192, in paint
    t.temp_labelbox = canvas.texrunner.text_pt(t.temp_x_pt, t.temp_y_pt, t.label, labelattrs)
  File "/usr/local/lib/python3.6/site-packages/pyx/text.py", line 1428, in wrapped
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pyx/text.py", line 1459, in text_pt
    return self.instance.text_pt(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pyx/text.py", line 1278, in text_pt
    left_pt, right_pt, height_pt, depth_pt = self.do_typeset(expr, self.texmessages_run_default + self.texmessages_run + texmessages)
  File "/usr/local/lib/python3.6/site-packages/pyx/text.py", line 1201, in do_typeset
    self.do_start()
  File "/usr/local/lib/python3.6/site-packages/pyx/text.py", line 1344, in do_start
    super().do_start()
  File "/usr/local/lib/python3.6/site-packages/pyx/text.py", line 1156, in do_start
    self.popen = config.Popen(cmd, stdin=config.PIPE, stdout=config.PIPE, stderr=config.STDOUT, bufsize=0)
  File "/usr/local/lib/python3.6/site-packages/pyx/config.py", line 190, in Popen
    return subprocess.Popen(cmd, *args, **kwargs)
  File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1326, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'tex'
-- Fin du message d'erreur --

Je sèche là depuis plusieurs heures... Quelqu'un aurait-il une idée ?

Merci. Bonne journée.

--
Olivier