사용자 정의 가능한 데이터 그래프 및 시각화를위한 Python 모듈 인 pyx로 작업을 수행하고 있습니다. 문제는 가장 기본적인 그래프 코드 예제를 직접 복사하여 붙여 넣어도 손상된 파일과 오류를 반환한다는 것입니다. Im 비교적 파이썬에 익숙하지 않고 이전에 이와 같은 오류를 본 적이 없습니다. 내 머리 위로 waaaaay입니다. 전에 간단한 캔버스 그리기를 실행했는데 제대로 작동했습니다. 여기서 무슨 일이야?
암호:
from pyx import *
g = graph.graphxy(width=10,
x=graph.axis.linear(min=-2, max=2)
)
g.plot(graph.data.function("y(x)=x**2"))
g.writeEPSfile("x")
빨간색 오류 텍스트 :
Traceback (most recent call last):
File "C:\Users\User\Desktop\test.py", line 9, in <module>
g.writeEPSfile("x")
File "C:\Python34\lib\site-packages\pyx\canvas.py", line 50, in wrappedindocument
return method(d, file, **write_kwargs)
File "C:\Python34\lib\site-packages\pyx\document.py", line 180, in writeEPSfile
pswriter.EPSwriter(self, f, **kwargs)
File "C:\Python34\lib\site-packages\pyx\pswriter.py", line 142, in __init__
page.processPS(pagefile, self, acontext, registry, pagebbox)
File "C:\Python34\lib\site-packages\pyx\document.py", line 130, in processPS
self._process("processPS", *args)
File "C:\Python34\lib\site-packages\pyx\document.py", line 78, in _process
bbox.set(self.canvas.bbox()) # this bbox is not accurate
File "C:\Python34\lib\site-packages\pyx\graph\graph.py", line 181, in bbox
self.finish()
File "C:\Python34\lib\site-packages\pyx\graph\graph.py", line 303, in finish
self.doaxes()
File "C:\Python34\lib\site-packages\pyx\graph\graph.py", line 580, in doaxes
self.dolayout()
File "C:\Python34\lib\site-packages\pyx\graph\graph.py", line 564, in dolayout
self.doaxiscreate(axisname)
File "C:\Python34\lib\site-packages\pyx\graph\graph.py", line 240, in doaxiscreate
self.axes[axisname].create()
File "C:\Python34\lib\site-packages\pyx\graph\axis\axis.py", line 620, in create
self.linkedto.docreate()
File "C:\Python34\lib\site-packages\pyx\graph\axis\axis.py", line 525, in docreate
self._createfunction(*self._createargs, **self._createkwargs)
File "C:\Python34\lib\site-packages\pyx\graph\graph.py", line 240, in doaxiscreate
self.axes[axisname].create()
File "C:\Python34\lib\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 "C:\Python34\lib\site-packages\pyx\graph\axis\axis.py", line 250, in create
return _regularaxis._create(self, data, positioner, graphtexrunner, self.parter, self.rater, errorname)
File "C:\Python34\lib\site-packages\pyx\graph\axis\axis.py", line 220, in _create
variants[0].storedcanvas = layout(variants[0])
File "C:\Python34\lib\site-packages\pyx\graph\axis\axis.py", line 141, in layout
self.painter.paint(canvas, data, self, positioner)
File "C:\Python34\lib\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 "C:\Python34\lib\site-packages\pyx\text.py", line 1408, in wrapped
return f(self, *args, **kwargs)
File "C:\Python34\lib\site-packages\pyx\text.py", line 1439, in text_pt
return self.instance.text_pt(*args, **kwargs)
File "C:\Python34\lib\site-packages\pyx\text.py", line 1261, in text_pt
left_pt, right_pt, height_pt, depth_pt = self.do_typeset(expr, self.texmessages_run_default + self.texmessages_run + texmessages)
File "C:\Python34\lib\site-packages\pyx\text.py", line 1184, in do_typeset
self.do_start()
File "C:\Python34\lib\site-packages\pyx\text.py", line 1326, in do_start
super().do_start()
File "C:\Python34\lib\site-packages\pyx\text.py", line 1139, in do_start
self.popen = config.Popen(cmd, stdin=config.PIPE, stdout=config.PIPE, stderr=config.STDOUT, bufsize=0)
File "C:\Python34\lib\site-packages\pyx\config.py", line 190, in Popen
return subprocess.Popen(cmd, *args, **kwargs)
File "C:\Python34\lib\subprocess.py", line 858, in __init__
restore_signals, start_new_session)
File "C:\Python34\lib\subprocess.py", line 1111, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
PyX는 TeX를 사용하여 텍스트 출력을 생성합니다. 당신이 보여주는 역 추적은 TeX 인터프리터를 시작할 수 없기 때문입니다. traceback에 표시된 text.py의 1139 행 cmd
에는 문자열이 포함 tex
되며 오류는 하위 프로세스 모듈 이이 실행 파일을 찾지 못한다는 사실에서 비롯됩니다. TeX가 이미 설치되어있는 경우 TeX 실행 파일의 검색 경로를 포함하도록 PATH 환경 변수를 설정하거나 TeX 실행 파일의 전체 경로 이름을 사용하도록 pyxrc를 사용하여 PyX를 구성 할 수 있습니다. 아직 TeX를 설치하지 않은 경우 TeX Live 또는 MiKTeX 와 같은 TeX 배포판을 설치하십시오 . PyX는 두 가지 모두와 다른 TeX 배포판에서도 실행할 수 있어야합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다