question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to upload local files: google.colab.__files is undefined

See original GitHub issue

Using the file upload code snippet on both python3 and python2 I get the error message:

---------------------------------------------------------------------------
MessageError                              Traceback (most recent call last)
<ipython-input-3-292f82be1b7a> in <module>()
      1 from google.colab import files
      2 
----> 3 uploaded = files.upload()
      4 
      5 for fn in uploaded.keys():

/usr/local/lib/python3.6/dist-packages/google/colab/files.py in upload()
     59   result = output.eval_js(
     60       'google.colab._files._uploadFiles("{input_id}", "{output_id}")'.format(
---> 61           input_id=input_id, output_id=output_id))
     62   files = collections.defaultdict(six.binary_type)
     63 

/usr/local/lib/python3.6/dist-packages/google/colab/output/_js.py in eval_js(script, ignore_result)
     37   if ignore_result:
     38     return
---> 39   return _message.read_reply_from_input(request_id)
     40 
     41 

/usr/local/lib/python3.6/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec)
     84         reply.get('colab_msg_id') == message_id):
     85       if 'error' in reply:
---> 86         raise MessageError(reply['error'])
     87       return reply.get('data', None)
     88 

MessageError: TypeError: google.colab._files is undefined

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

10reactions
guptasaurabh9868commented, Apr 22, 2018

It is also happening in google chrome.

6reactions
bloiscommented, Aug 28, 2018

There is a new file upload UI in the notebook sidebar, alongside the table of contents.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to upload local files in google colab - Stack Overflow
This is the code that I used. from google.colab import files uploaded = files.upload(). Everytime I execute it, it is showing the ...
Read more >
Can't upload local files in colab - Brave Community
Using Google's colab in Brave browser (Mac High Sierra 10.13.6). Trying to upload local file: from google.colab import files uploaded ...
Read more >
Python – Not able to upload local files in google collaboratory
I am trying to upload a word2vec file in Google Colaboratory from local system and use it further in the in code. This...
Read more >
No longer able to upload files No error message Can't close ...
I lost the ability to attach files from my computer. It acts like it's downloading but then it goes blank. No attachment.
Read more >
How to Upload Files to Google Colab - YouTube
In this video, I will be showing you how to upload files from your local computer to your Python notebook or R notebook...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found