-
Notifications
You must be signed in to change notification settings - Fork 662
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
Errors when running on Windows #137
Comments
why is jupyter-book trying to access the .git folder? :-) |
Ooooh! Good question @jasmainak! I didn’t follow the instructions and made my repo on GitHub (and cloned it locally) so I had a .git folder already. The actual instructions tell you to do that later. So there’s a mistake on my part there....but also maybe there’s something to update so Jupyter book ignores the .git folder! (I don’t know the answer, totally noob here!!) Thank you for taking a look @emdupre! I hope my ramblings aren’t too incoherent!! Happy to test anything as needed 🌸 |
I'm also new to the codebase :-) But looking at it, there seems to be an Errors should never pass silently. |
Also, are you able to reproduce the error faithfully? It could be a temporary issue as another process might be locking the folder ... |
I have encountered similar errors: SO: Windows 7 Professional SP1
|
Hi @netoferraz, thanks for chiming in ! It's good to know that this is occurring for multiple users. It may take us a few days to look into it (a little slow on development cycles right now), but please do submit a patch if you're able and interested ! In the meantime, we have instructions for building with Docker that should allow you to circumvent Windows-specific issues: https://jupyter.org/jupyter-book/guide/03_build.html#building-your-site-locally-with-containers-docker |
I think the culprit is some unicode character in the files. If you want to fix it, these lines would have to be changed so that they specify an encoding. |
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.
|
@stafforddavidj thanks for noting that! Any chance you'd be willing to make a PR updating that line so we can see if the tests are still happy? :-) |
[FIX] Issue #137 Errors when running on Windows
@KirstieJane wanna check if this is fixed when running "master" now? |
Hi all, I'm working with the current master (dda4a03) in a conda 4.6.14 / Python 3.6.8 environment under Windows 10, and encountered this same issue. I could only get things working after passing the UTF-8 encoding flag when opening files for writing: # Write the result as UTF-8.
with open(path_new_file, 'w', encoding='utf8') as ff:
ff.writelines(lines) in addition to the fix for reading suggested by @stafforddavidj. Should that be added as well, or is that a unique quirk of my setup? Thanks! |
it sounds like the utf8 encoding needs to be there for it to work on windows...but I thought this had been fixed so now I'm confused :-/ isn't that what was fixed in cbc512d ? |
I think cbc512d fixes it for |
just realized that I had dropped this one - that's a good point @cczhu , if the fix you proposed solves this problem for you, then I think we should make a PR - I'm happy to review if you open one up! |
@choldgraf sure thing, opened PR #225 with the proposed fix. |
I believe this is now fixed with @cczhu 's patches, thanks! |
I hope I can reopen the issue this way... I am unable to convert any book on windows with the similar issue as above
The last thing I tried to test, whether the issue depends on my .ipynb files:
This produced the same error message as above as for any other included ipynb I tried. Before I did this, one thing was to just pip install jupyter book and this produced the error that I should upgrade it. But at least, it let me successfully run Thanks, I appreaciate any help :) |
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: |
Lifted from @KirstieJane feedback in #134
jupyter-book build mybookname
fails with:jupyter-book create mybookname --demo --overwrite
fails with: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).The text was updated successfully, but these errors were encountered: