abdullahkhalids / qecft

The book A Methods Focused Guide to Quantum Error Correction and Fault-Tolerant Quantum Computation
Other
17 stars 7 forks source link

Problems creating local html files when running Make #7

Closed MZuhairKhan closed 1 year ago

MZuhairKhan commented 1 year ago

Error: Converting to HTML now... Deleting existing build directory Copying folders: ['static', 'images'] Creating toc structure from order and caption files Converting each section to a html page

1.1 About this book Traceback (most recent call last): File "C:\Users\khanm\OneDrive\Desktop\Projects\qecft\bookcreator.py", line 230, in convert_section_to_html(sec) File "C:\Users\khanm\OneDrive\Desktop\Projects\qecft\bookcreator.py", line 148, in convert_section_to_html f.write(template.render(**j2_vars)) File "C:\Users\khanm\miniconda3\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2630' in position 8413: character maps to Makefile:6: recipe for target 'all' failed make: *** [all] Error 1

Local enviroment: OS Name: Microsoft Windows 10 Home OS Version: 10.0.19044 N/A Build 19044 Python version: Python 3.10.9

Execution: 1) Git pull upstream main 2) Created and activated envqecft manually as the command in Make does not work on my local computer. 3) Used requirements.txt to install dependencies. 4) Commented out line 6 in Makefile 5) Run Make in cmd.

abdullahkhalids commented 1 year ago

Thank you. I have committed a change that should hopefully fix it. Please pull the repo again.

The minimal steps to build on Windows are as follows (please correct me if I am wrong as I don't use windows). Note I changed the location of the virtual environment to make life easier.

virtualenv -p python3.10 envqecft
# now activate on Windows
# this is the step I am not sure of. Please let me know if this command is incorrect
\envqecft\Scripts\activate.bat 
# now build html
python bookcreator.py
# minify the css files
css-html-js-minify build/static/css/ >/dev/null 2>&1

Please let me know if this works. If it does, I will try to write a make file that works on Windows. If not, post the error message. Thank you for your patience.

MZuhairKhan commented 1 year ago

Yes, that works now! The command is correct as well! I will test my conversion on the html files now.