OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

AttributeError: 'float' object has no attribute 'timeout'

  • Thread starter Thread starter NovaTec
  • Start date Start date
N

NovaTec

Guest
Code:
AttributeError                            Traceback (most recent call last)
<ipython-input-33-df22a7fa1657> in <module>
     43 '''
     44 
---> 45  resp = urllib.request.urlopen(Imagen, timeout=300)
     46  background = Image.open(resp).convert("RGBA")
     47  background.thumbnail((150,150))

1 frames
/usr/lib/python3.8/urllib/request.py in open(self, fullurl, data, timeout)
    513                 req.data = data
    514 
--> 515         req.timeout = timeout
    516         protocol = req.type
    517 

AttributeError: 'float' object has no attribute 'timeout

Im run this code on Colab of google

and I have this problem with

Code:
 resp = urllib.request.urlopen(Imagen, timeout=300)

When Imagen is a list of URLS, in a csv file.
<pre><code>


AttributeError Traceback (most recent call last)
<ipython-input-33-df22a7fa1657> in <module>
43 '''
44
---> 45 resp = urllib.request.urlopen(Imagen, timeout=300)
46 background = Image.open(resp).convert("RGBA")
47 background.thumbnail((150,150))

1 frames
/usr/lib/python3.8/urllib/request.py in open(self, fullurl, data, timeout)
513 req.data = data
514
--> 515 req.timeout = timeout
516 protocol = req.type
517

AttributeError: 'float' object has no attribute 'timeout
</code></pre>
<p>Im run this code on Colab of google</p>
<p>and I have this problem with</p>
<pre><code> resp = urllib.request.urlopen(Imagen, timeout=300)
</code></pre>
<p>When Imagen is a list of URLS, in a csv file.</p>
 
Top