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

error in windows 10 #180

Closed
phsheth opened this issue Sep 21, 2019 · 12 comments
Closed

error in windows 10 #180

phsheth opened this issue Sep 21, 2019 · 12 comments

Comments

@phsheth
Copy link

phsheth commented Sep 21, 2019

I get the following error:

(base) C:\Users\Pushkar Sheth>doconce format pdflatex report1
translating doconce text in report1.do.txt to pdflatex
*** error: could not open the file ../model.py used in
@@@CODE ../model.py  fromto: def solver@def u_exact
[Errno 2] No such file or directory: '../model.py'
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\doconce\doconce.py", line 1403, in insert_code_from_file
    codefile = open(filename, 'r')
FileNotFoundError: [Errno 2] No such file or directory: '../model.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\Scripts\doconce-script.py", line 1722, in <module>
    bg_session = main()
  File "C:\ProgramData\Anaconda3\Scripts\doconce-script.py", line 1711, in main
    retval = eval(command + '()')
  File "<string>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\Scripts\doconce-script.py", line 102, in format
    bg_session = doconce.doconce.format_driver()
  File "C:\ProgramData\Anaconda3\lib\site-packages\doconce\doconce.py", line 5541, in format_driver
    out_filename, bg_session = file2file(filename_preprocessed, format, basename)
  File "C:\ProgramData\Anaconda3\lib\site-packages\doconce\doconce.py", line 4353, in file2file
    filestr, bg_session = doconce2format(filestr, format)
  File "C:\ProgramData\Anaconda3\lib\site-packages\doconce\doconce.py", line 4556, in doconce2format
    filestr, num_files = insert_code_from_file(filestr, format)
  File "C:\ProgramData\Anaconda3\lib\site-packages\doconce\doconce.py", line 1416, in insert_code_from_file
    errwarn(e)
  File "C:\ProgramData\Anaconda3\lib\site-packages\doconce\doconce.py", line 273, in errwarn
    err.write(msg)
TypeError: write() argument must be str, not FileNotFoundError
@phsheth phsheth closed this as completed Sep 21, 2019
@phsheth
Copy link
Author

phsheth commented Sep 21, 2019

apologies. i think the bit.ly link in the sample code for trials is missing.

@phsheth
Copy link
Author

phsheth commented Sep 21, 2019

All files present here (except citations bib file):
https://github.com/hplgit/hplgit.github.com/tree/master/teamods/writing_reports/doconce_src

@KGHustad
Copy link
Collaborator

The second exception shouldn't occur, so that's very much a valid bug.

@phsheth
Copy link
Author

phsheth commented Sep 21, 2019

The second exception shouldn't occur, so that's very much a valid bug.

The exception goes away after all files are included in the folder. It has generated the tex file. I think some .sty files are missing (ptex2tex.sty). For which i think i need to read this: https://github.com/hplgit/ptex2tex/blob/master/README.
Which I will do tomorrow.

@phsheth
Copy link
Author

phsheth commented Sep 21, 2019

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.
! Package minted Error: You must have `pygmentize' installed to use this package.

! Undefined control sequence.
l.404 \bpycod

@phsheth
Copy link
Author

phsheth commented Sep 21, 2019

Boom! suddenly I have the PDF compiled by texworks
Implementation section does not have the code written properly...

@phsheth phsheth reopened this Sep 21, 2019
@phsheth
Copy link
Author

phsheth commented Sep 23, 2019

Although DocOnce seems to be working fair - I am having trouble with the minted package. Went around trouble shooting the minted errors online but I am stuck on an error with \inputlistings line not being fed properly. @KGHustad - by any chance do u have an idea how to deal with it?

@phsheth
Copy link
Author

phsheth commented Sep 23, 2019

I know I am not really helping by pasting all error messages here, but heres the latest:

(base) C:\Users\Pushkar Sheth\Documents\work\doconce_trials\setup4book-doconce-master\doc\src\book>doconce format pdflatex book.do.txt
running preprocess -DFORMAT=pdflatex -DDEVICE=screen  book.do.txt > tmp_preprocess__book.do.txt
Could not run preprocessor:
preprocess -DFORMAT=pdflatex -DDEVICE=screen  book.do.txt > tmp_preprocess__book.do.txt
'preprocess' is not recognized as an internal or external command,
operable program or batch file.

return code from preprocess: 1
Abort! (add --no_abort on the command line to avoid this abortion)

@KGHustad
Copy link
Collaborator

Have you installed preprocess in the same conda environment? If not, try conda install -c conda-forge preprocess.

preprocess should show up when you run the following command

conda list preprocess

@phsheth
Copy link
Author

phsheth commented Sep 23, 2019

I think we are at the last leg of debugging.
the report.do.txt is generating, \inputlistings issue is also solved.
now to solve preprocess issue.

@KGHustad - do u have a more recent version of the book style format used for recently printed books?

(base) C:\Users\Pushkar Sheth\Documents\work\doconce_trials\setup4book-doconce-master\doc\src\book>conda list preprocess
# packages in environment at C:\ProgramData\Anaconda3:
#
# Name                    Version                   Build  Channel
preprocess                1.2.3                      py_1    conda-forge

(base) C:\Users\Pushkar Sheth\Documents\work\doconce_trials\setup4book-doconce-master\doc\src\book>doconce format pdflatex book.do.txt
running preprocess -DFORMAT=pdflatex -DDEVICE=screen  book.do.txt > tmp_preprocess__book.do.txt
Could not run preprocessor:
preprocess -DFORMAT=pdflatex -DDEVICE=screen  book.do.txt > tmp_preprocess__book.do.txt
'preprocess' is not recognized as an internal or external command,
operable program or batch file.

return code from preprocess: 1
Abort! (add --no_abort on the command line to avoid this abortion)

(base) C:\Users\Pushkar Sheth\Documents\work\doconce_trials\setup4book-doconce-master\doc\src\book>

@KGHustad
Copy link
Collaborator

The issue is that Windows does not seem to recognise preprocess as a command even though it should be present in the environment.
Could you try running preprocess or preprocess.exe in the Anaconda command prompt?
I don't know if I have ever tested preprocess on Windows, but I wasn't expecting it to cause any problems.

The book style format has not changed in the past couple of years. I know it could probably use an update, but I don't have the time to do that anytime soon.

@phsheth
Copy link
Author

phsheth commented Sep 25, 2019

I appreciate your help @KGHustad. Closing this issue here because it is external to doconce.

@phsheth phsheth closed this as completed Sep 25, 2019
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