I'm reading a book by myself and following along. We are currently in the process of importing images from the Internet as a request. I used the requests module and there was an error until installation, but I solved it. On the other hand, as a result of entering url and the following code,
r = requests.get(url, stream=True).raw
An error appears like this.
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
r = requests.get(url, stream=True).raw
AttributeError: module 'requests' has no attribute 'get'
As a result of hard googling, this problem occurs when the file name is the same as requests In this case, the problem occurs in an empty shell that has not even been saved.
I have no idea how to solve it. I'd really appreciate your help. I ask you a question politely.
python
According to the error message, it seems that you did not import the module after installing it.
import requests
r = requests.get(url, stream=True).raw
© 2024 OneMinuteCode. All rights reserved.