You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OK. What is happening is your response.content is empty and thus raising an error. It is empty because response was the defined earlier in the notebook (beginning of Section 8.5) and your commands seem to be standalone.
These commands needs to be run in the same notebook as where the previous commands were. In the comments notice it says In[4] which means it's the fourth cell in a series of commands.
Alternatively, what you can do is add the following snippet to your 4 lines above and rerun
It's strange because I ran the same commands in 4 separate cells (but in the same notebook) and for some reason it didn't identify the io.BytesIO object in the fourth cell.
Thanks for helping out. You book has been very useful!
It's strange because I ran the same commands in 4 separate cells (but in the same notebook) and for some reason it didn't identify the io.BytesIO object in the fourth cell.
Just for your knowledge, this could would have happened because you may have shutdown the notebook / VSCode. The cell execution results do not persist across restarts.
Thanks for helping out. You book has been very useful!
🙂 Always encouraging to head good things, if possible please leave a review so it gets more exposures.
Activity
rehanhaider commentedon Oct 29, 2021
@AlexAdamov Thank you for raising this.
Can you share a copy of your Jupyter notebook or the code that you are using please?
rehanhaider commentedon Oct 29, 2021
@AlexAdamov
This looks like an error, you need to change the comma (,) to a period (.) and try again
This should solve the problem
Can you try this and let me know if it solves your problem please?
ysqander commentedon Oct 30, 2021
Hi thanks for the quick reply.
The error happens one step before the typo at
image = Image.open(io.BytesIO(response.content)).
rehanhaider commentedon Oct 30, 2021
OK. What is happening is your
response.contentis empty and thus raising an error. It is empty becauseresponsewas the defined earlier in the notebook (beginning of Section 8.5) and your commands seem to be standalone.These commands needs to be run in the same notebook as where the previous commands were. In the comments notice it says
In[4]which means it's the fourth cell in a series of commands.Alternatively, what you can do is add the following snippet to your 4 lines above and rerun
Let me know if this works
ysqander commentedon Oct 30, 2021
The last alternative - all in one cell worked :-)
It's strange because I ran the same commands in 4 separate cells (but in the same notebook) and for some reason it didn't identify the io.BytesIO object in the fourth cell.
Thanks for helping out. You book has been very useful!
rehanhaider commentedon Oct 30, 2021
Just for your knowledge, this could would have happened because you may have shutdown the notebook / VSCode. The cell execution results do not persist across restarts.
🙂 Always encouraging to head good things, if possible please leave a review so it gets more exposures.