pdflatex test.tex(this generates pytx code)
pythontex.bat test.tex(parses pytx code)
pdflatex test.tex(this generates pdf)
In Lyx, I set up the file formats as discussed in the previous post:
LaTeX (pytex1); shortname=
LaTeX (pytex2); shortname=
PDF (pytex); shortname=
LaTeX (pdflatex); to=
LaTeX (pytex1); converter=
pdflatex $$i; extra=
LaTeX (pytex1); to=
LaTeX (pytex2); converter=
pythontex.bat $$i; extra=``
LaTeX (pytex2); to=
PDF (pytex); converter=
pdflatex $$i; extra=
which follows the test run described above.
This isn't working as expected; step 1 of the conversion works fine, i.e.
pdflatex is run on the tex file to create the pytx code. However, step 2 fails with the following message:
09:11:07.158: pythontex.bat "test.pytex1ext" 09:11:07.188: 09:11:07.193: C:\Users\xxx\AppData\Local\Temp\lyx_tmpdir>python "c:/users/xxx/documents/localtexmf/scripts/pythontex/pythontex.py" test.pytex1ext 09:11:07.575: Traceback (most recent call last): 09:11:07.580: File "c:/users/xxx/documents/localtexmf/scripts/pythontex/pythontex.py", line 50, in <module> 09:11:07.584: import pythontex2 as pythontex 09:11:07.587: File "c:\users\xxx\documents\localtexmf\scripts\pythontex\pythontex2.py", line 60, in <module> 09:11:07.590: import multiprocessing 09:11:07.592: ImportError: No module named multiprocessing ..\..\..\src\support\Systemcall.cpp (292): Systemcall: 'pythontex.bat "test.pytex1ext"' finished with exit code 1 Error: Cannot convert file
This fails obviously because in
C:\Users\xxx\AppData\Local\Temp\lyx_tmpdir there is no file
test.pytex1ext which is the extension defined in format 1 but just the file
test.tex. So what happens when i change the extension to
tex instead? Then the second step tries to run:
which obviously also does not exist. Who has an idea how to sort this out? I am close but can't get it to work.
Note: The ImportError on the
multiprocessing module worries me slightly as well as it is working fine when running
pythotex.bat from the command prompt, but i want to get the extension right first and see if the issue remains.