title: File not found when using gspread import_csv function in python
body: <p>I am using gspread package in python.</p>
  
  <p>I try to import a csv into a google spreadsheet but I got an error.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>import gspread
  from oauth2client.service_account import ServiceAccountCredentials
  
  spreadsheet_id = '1tFhK2-zebkG1fZFF6Xe5LHyONkh97ANOkcf'
  
  scopes = [
      'https://spreadsheets.google.com/feeds',
      'https://www.googleapis.com/auth/drive'
  ]
  
  creds = ServiceAccountCredentials.from_json_keyfile_name('./credentials.json', scopes=scopes)
  
  client = gspread.authorize(creds)
  
  file = open('test_csv.csv',mode='r')
  csv = file.read()
  file.close()
  
  client.import_csv(spreadsheet_id, csv)
  </code></pre>
  
  <p>The error I got is:</p>
  
  <pre><code>---------------------------------------------------------------------------
  APIError                                  Traceback (most recent call last)
  &lt;ipython-input-264-eb5d4ce7bc69&gt; in &lt;module&gt;()
  ----&gt; 1 client.import_csv(spreadsheet_id, csv)
  
  ~/anaconda3/lib/python3.6/site-packages/gspread/client.py in import_csv(self, file_id, data)
      238                 'convert': True
      239             },
  --&gt; 240             headers=headers
      241         )
      242 
  
  ~/anaconda3/lib/python3.6/site-packages/gspread/client.py in request(self, method, endpoint, params, data, json, files, headers)
       77             return response
       78         else:
  ---&gt; 79             raise APIError(response)
       80 
       81     def list_spreadsheet_files(self):
  
  APIError: {
   "error": {
    "errors": [
     {
      "domain": "global",
      "reason": "notFound",
      "message": "File not found: 1tFhK2-zebkG1fZFF6Xe5LHyONkh97ANOkcf",
      "locationType": "other",
      "location": "file"
     }
    ],
    "code": 404,
    "message": "File not found: 1tFhK2-zebkG1fZFF6Xe5LHyONkh97ANOkcf"
   }
  }
  </code></pre>
  
  <p>However, I get no error when I try to read or write on cell directly (with <code>update_cell</code> function for example), so the spreadsheet does exist and I can write on it. It is specifically <code>import_csv</code> that throws an error.</p>
  
  <p>I have created the google sheet through the google drive web interface. I then added my client_email from credential.json (blabla@blabla-220209.iam.gserviceaccount.com) in the authorized mail of the spreadsheet.</p>
  
  <p>Any suggestion ?</p>