title: How to download a file from GoogleColab in python script?
body: <p>I have a python script which creates a <code>.csv</code> file. </p>
  
  <p>When I try downloading the file <code>Vectors.csv</code>(the file created by the code) within the script by</p>
  
  <pre><code>df.to_csv("Vectors.csv", sep=",", index=False)
  files.download("Vectors.csv")  
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>Traceback (most recent call last):
  File "/content/gdrive/My Drive/Deep/makeVectors.py", line 52, in &lt;module&gt;
  files.download("Vectors.csv")
  File "/usr/local/lib/python3.6/dist-packages/google/colab/files.py", line 178, in download
  'name': _os.path.basename(filename),
  File "/usr/local/lib/python3.6/dist-packages/google/colab/output/_js.py", line 35, in eval_js
  kernel = _ipython.get_kernel()
  File "/usr/local/lib/python3.6/dist-packages/google/colab/_ipython.py", line 28, in get_kernel
  return get_ipython().kernel
  AttributeError: 'NoneType' object has no attribute 'kernel'
  </code></pre>
  
  <p>Whereas when I type the same commands in Colab cells, it works fine.</p>
  
  <p>Browser: Google Chrome</p>