python 3.6 + pyX := problème

Le
stalker5
Bonjour à toutes et à tous,

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

Voici les quelques lignes suivantes :

#début
from pyx import *

g = graph.graphxy(width=8, x=graph.axis.linear(min=-15, max))
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

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
Vos réponses
Gagnez chaque mois un abonnement Premium avec GNT : Inscrivez-vous !
Trier par : date / pertinence
Benoit Izac
Le #26425880
Bonjour,
Le 10/02/2017 à 14:58, stalker5 a écrit dans le message
FileNotFoundError: [Errno 2] No such file or directory: 'tex'

PyX invoque le programme « tex » qui n'existe visiblement pas sur ta
machine (en tout cas pas dans ton $PATH). Je ne connais pas Mac OS
X mais c'est de ce coté là qu'il faut chercher car ton script
fonctionne.
--
Benoit Izac
Publicité
Poster une réponse
Anonyme