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.

`_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)

image

Versions

main

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ejguancommented, Feb 18, 2022

And, the reason it happens on Colab is:

google-colab 1.0.0 requires requests~=2.23.0, but you have requests 2.27.1 which is incompatible.

2reactions
ejguancommented, Feb 18, 2022

Found the culprit. We rely on requests to provide correct HTTPResponse and requests is relying on urllib3 to decompress the content within HTTPResponse. But, for urllib3 1.24, __iter__ within HTTPRespnse 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

Read more comments on GitHub >

github_iconTop 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 >

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