QuantEcon / jupinx

Jupyter + Sphinx Utilities and Tools
https://quantecon.github.io/jupinx/
20 stars 4 forks source link

NewConnectionError when building websites from notebooks that access the web #101

Open MaxGhenis opened 4 years ago

MaxGhenis commented 4 years ago

I'm using jupinx to build an rst that pulls data from the web, The executed notebook builds fine, but the webpage gives this error:

NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7e2a5d9b4690>: Failed to establish a new connection: [Errno -2] Name or service not known ... MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /PSLmodels/Tax-Calculator/master/taxcalc/reforms/2017_law.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7e2a5d9b4690>: Failed to establish a new connection: [Errno -2] Name or service not known'))

I've tried rebuilding a couple times, but the error is consistent.

mmcky commented 4 years ago

thanks for reporting @MaxGhenis -- will try and take a look this week.

MaxGhenis commented 4 years ago

FYI I'm getting the same error in jupyter-book: https://github.com/executablebooks/jupyter-book/issues/735

AakashGfude commented 4 years ago

@MaxGhenis , can you send along the rst which is causing this error? The rst link above gives 404. From the error screenshot, it looks more like a urllib or other python package configuration/bug then jupinx bug itself.

MaxGhenis commented 4 years ago

https://github.com/PSLmodels/Tax-Calculator/blob/1eb9c41d957fd8b14213a05e6a1686eb8dd0afad/docs/jupinx/source/recipe01.rst

I haven't had this issue running it locally as a notebook before.

AakashGfude commented 4 years ago

@MaxGhenis So, I ran the build for your rst file. Same as in your case I suppose, the website produced locally works fine. But it throws the error in github pages or htmlpreview.github.io. I suspect there might be some proxy or other things involved in these hosted services, or has to do with urllib3, or the taxcalc package? Which we cant particularly fix in jupinx ? Let me know what you think.

mmcky commented 4 years ago

hey @MaxGhenis -- are you using CI to build your project? @AakashGfude is indicating that locally this builds ok but may not establish a connection via urllib when building on a remote service?

MaxGhenis commented 4 years ago

No I'm not using CI. The notebook works when I run it through the Jupyter Notebook interface, but fails when it runs through jupyter-book build (locally).

It's also finicky--sometimes it runs OK with jupyter-book build and sometimes it doesn't.

MaxGhenis commented 4 years ago

See https://github.com/executablebooks/jupyter-book/issues/735#issuecomment-655923318