Local Installation for Programmers - USEPA/GWSC-Solver GitHub Wiki

Software Required

Simple notebooks work fine without any special setup steps

Install Jupyter extension by Microsoft

  • Ensure you “Trust” any downloaded notebooks when you open them (this is a popup from VS Code).
  • Select the Python version in top-right corner to choose the proper kernel. This can be the same as an existing virtual env, but you will need to install the Jupyter kernel pip package ipykernel.
  • Additional Information on Installation

PyPi packages

NOTE: scipy and numpy require the specific versions listed below. All other packages may be updated to their latest releases.

  • ipykernel>=5.5.0 # The IPython kernel for Jupyter.
  • numpy==1.19.3 # NumPy is the fundamental package for array computing with Python.
  • scipy==1.2.1 # SciPy: Scientific Library for Python
  • nbconvert_reportlab>=0.2 # An experimental tool to convert Jupyter notebooks to PDFs using Reportlab.
  • reportlab>=3.5.59 # The ReportLab Toolkit. An Open Source Python library for generating PDFs and graphics.

Additional information

https://github.com/microsoft/vscode-jupyter

Export your Jupyter Notebook

You can export a Jupyter Notebook as a Python file (.py), a PDF, or an HTML file. To export, just click the convert icon on the main toolbar. You'll then be presented with file options from the Command Palette.

Convert Notebook to pdf Run command from terminal jupyter nbconvert --to pdf-rl MyNotebook.ipynb

Convert Notebook to LaTeX Run command from terminal jupyter nbconvert --to latex mynotebook.ipynb

Convert Notebook to html Run command from terminal jupyter nbconvert --to html --template lab mynotebook.ipynb

If you have not installed xelatex (TeX) you will need to do so before you can export to PDF, for further instructions go to https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex.

Convert Jupyter Notebook to Python file

Note: For PDF export, you must have TeX installed. If you don't, you will be notified that you need to install it when you select the PDF option. Also, be aware that if you have SVG-only output in your Notebook, they will not be displayed in the PDF. To have SVG graphics in a PDF, either ensure that your output includes a non-SVG image format or else you can first export to HTML and then save as PDF using your browser.