jupyter-book: Errors when running on Windows
Lifted from @kirstieJane feedback in #134
jupyter-book build mybooknamefails with:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 693: character maps to <undefined>
jupyter-book create mybookname --demo --overwritefails with:
PermissionError: [WinError 5] Access is denied: '.\\mybookname\\.git\\objects\\01\\57a78648328b87569df49479a9813ce273e495'
My first guess at solutions: we should add in an .decode('utf-8') when reading in the markdown for (1) and update the documentation to add that the --overwrite command might need to be run with root privileges for (2).
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 18 (14 by maintainers)
Commits related to this issue
- [FIX] Issue #137 Errors when running on Windows (#187) [FIX] Issue #137 Errors when running on Windows — committed to executablebooks/jupyter-book by choldgraf 5 years ago
Here’s a section on the current status for windows users: tldr – you need to set an environment variable PYTHONUTF8=1 in either powershell or cmd.exe, then run jupyter-book: https://github.com/phaustin/jupyter-book/blob/windows/docs/advanced/advanced.md#working-on-windows
@choldgraf sure thing, opened PR #225 with the proposed fix.
I think https://github.com/jupyter/jupyter-book/commit/cbc512df254938c04207df97d63b170f3c2dd07e fixes it for
ff.readlines(), but notff.writelines(lines), though I’m not sure if the latter is only necessary for my build environment.I just encountered this same bug today.
Adding UTF-8 to the ‘encoding’ argument of the open() function in build.py allowed a successful build afterward.
I have encountered similar errors:
SO: Windows 7 Professional SP1 Python 3.7.1
why is jupyter-book trying to access the .git folder? 😃