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 rendering to html #35

Closed
RoxaneT opened this issue Aug 19, 2021 · 4 comments
Closed

Error rendering to html #35

RoxaneT opened this issue Aug 19, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@RoxaneT
Copy link

RoxaneT commented Aug 19, 2021

Describe the problem

I am trying to build a jupyter book and everything is alright until I try to build the HTML render using jupyter-book build my-book/. Then I get an error message saying ImportError: DLL load failed while importing win32api: The specified module could not be found.

From what I can tell win32api changed its name to pywin32. I installed that and even tried installing win32api but it says it can't be found (probably because the name changed). I don't know how to make jupyter books not look for win32api and look for pywin32 instead. Or maybe there's another way around the issue I haven't figured out.

Link to your repository or website

https://github.com/RoxaneT/en_Physics_test

Steps to reproduce

I put the folder with all the files from the book in the repo I linked. I followed the instructions in your readme, so if you clone that and try to build it from there you might get the same error.

The version of Python you're using

3.8

Your operating system

Windows 10 Pro

Versions of your packages

Jupyter Book      : 0.11.2
External ToC      : 0.2.3
MyST-Parser       : 0.13.7
MyST-NB           : 0.12.3
Sphinx Book Theme : 0.1.2
Jupyter-Cache     : 0.4.3
NbClient          : 0.5.4

Additional context

No response

@RoxaneT RoxaneT added the bug Something isn't working label Aug 19, 2021
@welcome
Copy link

welcome bot commented Aug 19, 2021

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@TomasBeuzen
Copy link
Collaborator

Hi @RoxaneT - thanks for the issue. This is probably a more suitable issue for the Jupyter/Jupyter Book repo than this cookiecutter repo (which is just a templating engine), but nevertheless, let's try to debug! Historically, windows has had some problems with Jupyter/Jupyter Book. I note a recent PR to the core Jupyter library makes some changes with the pywin32 dependency which might be related, but anyways.

I'm not a windows users and don't have access to a machine to try things out on, but I have a few suggestions which you could try, in order of increasing complexity:

  1. If you're using an environment manager like conda, make sure you're in the environment you installed jupyter-book into before trying to build the book. If you're not using a virtual environment read on (but I recommend using them :) )

  2. Uninstall and reinstall win32api and then run pywin32_postinstall.py script as suggested here while running Powershell as admin. Then try building your book again.

pip uninstall pywin32
pip install pywin32
pywin32_postinstall.py -install (or maybe python [your environment path]/Scripts/pywin32_postinstall.py -install)
  1. This SO thread makes a few suggestions such as using conda to install pywin32 in your environment, or changing the version of pywin32.

  2. Last but not least, try the steps at the bottom of this page to see if you can get a book working at all: https://jupyterbook.org/advanced/windows.html#working-on-windows. If you can get that book built, at least that will help debug your personal book.

Let me know how you go!

@RoxaneT
Copy link
Author

RoxaneT commented Aug 24, 2021

Thank you very much for your help! I was using a conda environment, so I tried your suggestion for uninstalling and reinstalling pywin32. That didn't help so I then tried building the book in 4. and after some fiddling around I managed to get it to work, so I used the same procedure for my book and it works now.

@RoxaneT RoxaneT closed this as completed Aug 24, 2021
@TomasBeuzen
Copy link
Collaborator

That's great, nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants