title: How to link own external modules in a Notebook with pyspark?
body: <p>I have a main IPython notebook in which I have the code that executes different tasks. </p>
  
  <p>I need to import an own module in form of .py file in the notebook, like this way:</p>
  
  <pre class="lang-py prettyprint-override"><code>from custom_module import function
  </code></pre>
  
  <p>We can suppose <code>custom_module.py</code> is:</p>
  
  <pre class="lang-py prettyprint-override"><code>def function(x): 
      print(x)
  </code></pre>
  
  <p>As I understand from the documentation, what I need to do is writting the following:</p>
  
  <pre class="lang-shell prettyprint-override"><code>$pyspark --py-files custom_module.py
  </code></pre>
  
  <p>The command above works only when the module is in same folder of ipynb but, what is I have module .py file in other directory?</p>
  
  <p>I tried code below with no good results. No module found. </p>
  
  <pre><code>$pyspark --py-files /home/username/desktop/test/custom_module.py
  </code></pre>