pyx-project / pyx

Repository of PyX, a Python package for the creation of PostScript, PDF, and SVG files.
https://pyx-project.org/
GNU General Public License v2.0
109 stars 18 forks source link

'SingleTexEngine' object has no attribute 'texoutput' #22

Closed ItsNickkk closed 3 years ago

ItsNickkk commented 4 years ago

I was trying to run the "hello.py" script, unmodified, just dragged from example folder to the root folder so that it would run, but I came across an error: did i screw up anything?


  File "c:/Users/x/Desktop/pyx-master/hello.py", line 4, in <module>
    c.text(0, 0, "Hello, world!")
  File "c:\Users\x\Desktop\pyx-master\pyx\canvas.py", line 409, in text
    return self.insert(self.textengine.text(x, y, atext, *args, **kwargs))
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1454, in wrapped
    return f(self, *args, **kwargs)
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1490, in text
    return self.instance.text(*args, **kwargs)
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1330, in text
    return self.text_pt(unit.topt(x), unit.topt(y), *args, **kwargs)
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1304, 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:\Users\x\Desktop\pyx-master\pyx\text.py", line 1221, in do_typeset
    self.do_start()
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1370, in do_start
    super().do_start()
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1176, in do_start
    self.popen = config.Popen(cmd, stdin=config.PIPE, stdout=config.PIPE, stderr=config.STDOUT, bufsize=0)
  File "c:\Users\x\Desktop\pyx-master\pyx\config.py", line 218, in Popen
    return subprocess.Popen(cmd, *args, **kwargs)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1307, in _execute_child       
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1035, in _cleanup
    self.do_finish(cleanup=False)
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1235, in do_finish
    self.go_finish()
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1364, in go_finish
    self._execute("\\end%\n", self.texmessages_end_default + self.texmessages_end, STATE_TYPESET, STATE_DONE)
  File "c:\Users\x\Desktop\pyx-master\pyx\text.py", line 1078, in _execute
    self.texoutput.expect(None)
AttributeError: 'SingleTexEngine' object has no attribute 'texoutput'```
bekatd commented 3 years ago

Same problem here. Did you get it solved somehow?

aellwein commented 3 years ago

Had the same issue here.

Apparently i missed the hint about the TeX installation in INSTALL.md. Now it works for me after brew install --cask basictex (i'm on a Mac).

luoshi006 commented 3 years ago

for ubuntu, just install tex by sudo apt install texlive-binaries