`_get_response_from_http` doesn't work on Colab.
See original GitHub issue🐛 Describe the bug
Code ponter here: https://github.com/pytorch/data/blob/6c5a9cb040740db1c5385fe9cc6ca3e5307d49f0/torchdata/datapipes/iter/load/online.py#L13
Faling code:
import requests
with requests.Session() as session:
r = session.get(url, stream=True)
print(r.raw.read())
Code with right result:
import requests
with requests.Session() as session:
r = session.get(url, stream=True)
print(r.text)
Versions
main
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
python - Get request for txt file doesn't work on local host , but ...
I'm trying to download the txt/csv file from the exchange. I have identified this url to ...
Read more >Google Colab don't response on pressing enter on Android
After Mounting workspace I can write anything I want into the input field, but when pressing enter Colab does nothing, just as it...
Read more >Explore data in Colab | BigQuery - Google Cloud
You can construct an arbitrary SQL query and explore the data in Colab. This approach is useful if you want to modify the...
Read more >Quickly share ML WebApps from Google Colab using ngrok ...
If you are in such a situation, This hack would come very handy because you'd be able to share your ML Web Application...
Read more >Getting Local with Google Colab - Medium
Even though your local notebook is generated, it still needs connected to the computing power. You will be able to do this by...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
And, the reason it happens on Colab is:
Found the culprit. We rely on
requests
to provide correctHTTPResponse
andrequests
is relying onurllib3
to decompress the content withinHTTPResponse
. But, forurllib3
1.24,__iter__
withinHTTPRespnse
was not implemented.I will open a PR to set
urllib3 >= 1.25
Please check https://colab.research.google.com/drive/1fy-RcRgjVIzN1MOejBBt50QIcIED2z1I?usp=sharing