title: Google Colab, module not found when running python script
body: <p>I have a Colab notebook open and have my files cloned from a github repo. I want to run a python script called <code>models.py</code>. In this file, I am using pandas. When I run this line in Colab:</p>
  
  <pre><code>!python3 models.py
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "models.py", line 1, in &lt;module&gt;
      import pandas as pd
  ModuleNotFoundError: No module named 'pandas'
  </code></pre>
  
  <p>However, if I run in a cell on Google Colab:</p>
  
  <pre><code>!pip3 list
  </code></pre>
  
  <p>I find that pandas is indeed installed:</p>
  
  <pre><code>pandas                   0.25.3  
  </code></pre>
  
  <p>My assumption is that when I run the script, it is not able to see the libraries I have installed but I am unsure how to fix this issue. </p>
  
  <p>If I run:</p>
  
  <pre><code>!which python3
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>/usr/local/bin/python3
  </code></pre>
  
  <p>The python file I am trying to run is under:</p>
  
  <pre><code>/content/my_project/models.py
  </code></pre>
  
  <p>Should I instead take a different approach to running this file?</p>