fastai / fastpages

An easy to use blogging platform, with enhanced support for Jupyter Notebooks.
https://fastpages.fast.ai/
Apache License 2.0
3.53k stars 755 forks source link

Unable to run or build example notebook in local developer environment #470

Closed keeran closed 3 years ago

keeran commented 3 years ago

Hello there :wave:

I can't find any reference to problems running locally, either in this repo or in the forums, so I hope this is a suitable report.

When attempting to run a local developer environment via docker-compose up, the introduction example notebook fails to execute due to missing Python libraries:

image

This is also reflected when the converter rebuilds the Markdown post:

image

Steps to reproduce

  1. Clone this repository locally
  2. Run docker-compose up
  3. Visit http://localhost:8080 and navigate to the _notebooks/2020-02-21-introducing-fastpages.ipynb to view the Python errors.
  4. Save the notebook / delete the existing Markdown from _posts and allow it to rebuild in the background.
  5. Visit http://localhost:4000/fastpages/jupyter/2020/02/21/introducing-fastpages.html to view the corresponding failed render.

I was able to work around this problem by editing the Dockerfile as follows:

FROM fastai/jekyll:2020-09-12
RUN pip install pandas altair
WORKDIR /fastpages
...

and then docker-compose build && docker-compose up

Happy to open a PR to include these changes, but curious if this needs to change elsewhere / another base image ought to be used?

Many thanks for this cool project! ✨

github-actions[bot] commented 3 years ago

Thank you for opening an issue. If this issue is related to a bug, please follow the steps and provide the information outlined in the Troubleshooting Guide. Failure to follow these instructions may result in automatic closing of this issue.

hamelsmu commented 3 years ago

You have to install pandas in this environment with !pip install pandas I guess I can add a cell that does that? Do you want to make a PR?

keeran commented 3 years ago

I guess I can add a cell that does that? Do you want to make a PR?

Sure thing, thanks for the tip - will get on it shortly.

keeran commented 3 years ago

@hamelsmu Not sure this is going to have the optimum effect:

image

image

It works now... but it's lost style points :)

keeran commented 3 years ago

Tried this but still breaks the flow

image

I'll read some more as I think you mentioned the ability to hide a cell from the output completely.

keeran commented 3 years ago

Ah yes, this does the trick for the generated markdown \o/

#hide
!pip install pandas altair;