title: Including common/utility Python code into Jupyter Notebook on AWS EMR
body: <p>I'd like to include code from another file in another Jupyter .ipynb file on the AWS Elastic MapReduce platform.</p>
  <p>But many of the methods I have seen online for including utility functions / common Python code that would seem to work outside of AWS, don't work inside the hosting environment for EMR-based Notebooks. I'm assuming this is file system security/server restrictions. If someone knows of an example of including code from a .py file and/or .ipynb file from the same directory that works on AWS I would love to see an example.</p>
  <p>This method did not work for me. The find_notebook returns None.
  <a href="https://jupyter-notebook.readthedocs.io/en/4.x/examples/Notebook/rstversions/Importing%20Notebooks.html" rel="nofollow noreferrer">https://jupyter-notebook.readthedocs.io/en/4.x/examples/Notebook/rstversions/Importing%20Notebooks.html</a></p>
  <p>or this library / method
  <a href="https://stackoverflow.com/questions/20186344/ipynb-import-another-ipynb-file">ipynb import another ipynb file</a></p>
  <p>Is there an AWS &quot;approved&quot; or recommended way of including common Python/PySpark code into a Jupyter Notebook?</p>
  <p>Note: this question
  <a href="https://stackoverflow.com/questions/64732902/how-to-import-from-another-ipynb-file-in-emr-jupyter-notebook-which-runs-a-pyspa">How to import from another ipynb file in EMR jupyter notebook which runs a PySpark kernel?</a>
  I have ssh'd into the master server and installed different packages like ipynb.
  Didn't work even though the module installed fine. And the environment can see it. But the overall technique did not work.</p>
  <p>Error:<br />
  An error was encountered:<br />
  &quot;'<strong>name</strong>' not in globals&quot;<br />
  Traceback (most recent call last):<br />
  KeyError: &quot;'<strong>name</strong>' not in globals&quot;</p>