Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package under Windows with Anaconda Python fails #23

Open
DavidLP opened this issue Jan 4, 2019 · 1 comment
Open

Package under Windows with Anaconda Python fails #23

DavidLP opened this issue Jan 4, 2019 · 1 comment

Comments

@DavidLP
Copy link

DavidLP commented Jan 4, 2019

Although pdflatex is added to the path variable I cannot get this package to work under Windows 10. The traceback when running the example is:

(base) C:\Users\David\git\latex>python sample_test.py
Traceback (most recent call last):
  File "sample_test.py", line 3, in <module>
    r = build_pdf(open('sample.latex'))
  File "C:\Users\David\git\latex\latex\build.py", line 232, in build_pdf
    return builder.build_pdf(source, texinputs)
  File "<decorator-gen-1>", line 2, in build_pdf
  File "C:\Users\David\Miniconda2\lib\site-packages\data\decorators.py", line 82, in _
    return f(*bvals.args, **bvals.kwargs)
  File "C:\Users\David\git\latex\latex\build.py", line 113, in build_pdf
    raise_from(LatexBuildError(base_fn + '.log'), e)
  File "C:\Users\David\Miniconda2\lib\site-packages\future-0.16.0-py2.7.egg\future\utils\__init__.py", line 454, in raise_from
    raise e
latex.exc.LatexBuildError: None

My environment:

  • Windows 10
  • Anaconda Python 2.7.15
  • pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6800 64-bit)
@dHannasch
Copy link

dHannasch commented Aug 13, 2019

To augment this with a minimal example:

python -c "import latex; latex.build_pdf(r'\documentclass{article}\begin{document}Hello\end{document}')"
Traceback (most recent call last):
  File "C:\Users\dahanna\AppData\Local\Continuum\anaconda3\envs\cleanEnvToInstallCorText\lib\site-packages\latex\b
uild.py", line 111, in build_pdf
    stderr=open(os.devnull, 'w'), )
  File "C:\Users\dahanna\AppData\Local\Continuum\anaconda3\envs\cleanEnvToInstallCorText\lib\subprocess.py", line
347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['latexmk', '-pdf', '-pdflatex=pdflatex -interaction=batchmode -halt-on-er
ror -no-shell-escape -file-line-error %O %S', 'C:\\Users\\dahanna\\AppData\\Local\\Temp\\tmpj2ugc6le\\tmp_7anpuy3.
latex']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\dahanna\AppData\Local\Continuum\anaconda3\envs\cleanEnvToInstallCorText\lib\site-packages\latex\b
uild.py", line 232, in build_pdf
    return builder.build_pdf(source, texinputs)
  File "<C:\Users\dahanna\AppData\Local\Continuum\anaconda3\envs\cleanEnvToInstallCorText\lib\site-packages\decora
tor.py:decorator-gen-1>", line 2, in build_pdf
  File "C:\Users\dahanna\AppData\Local\Continuum\anaconda3\envs\cleanEnvToInstallCorText\lib\site-packages\data\de
corators.py", line 82, in _
    return f(*bvals.args, **bvals.kwargs)
  File "C:\Users\dahanna\AppData\Local\Continuum\anaconda3\envs\cleanEnvToInstallCorText\lib\site-packages\latex\b
uild.py", line 113, in build_pdf
    raise_from(LatexBuildError(base_fn + '.log'), e)
  File "C:\Users\dahanna\AppData\Local\Continuum\anaconda3\envs\cleanEnvToInstallCorText\lib\site-packages\future\
utils\__init__.py", line 400, in raise_from
    exec(execstr, myglobals, mylocals)
  File "<string>", line 1, in <module>
latex.exc.LatexBuildError: None

This is likely related to #7 (comment)

Using the error-capture from #27 yields:

b"Latexmk: This is Latexmk, John Collins, 18 June 2019, version: 4.65.\nLatexmk: Filename 'C:\\Users\\dahanna\\App
Data\\Local\\Temp\\tmpboep692o\\tmpdyaq0rmd.latex' contains character not allowed for TeX file.\nLatexmk: Stopping
 because of bad filename(s).\n"

I think we're running into the same latexmk problem as atom-latex: thomasjo/atom-latex#480

For me, #28 resolved the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants