File "pictures.py", line 77, in show for img in album : TypeError: 'Image' object is not iterable
My code
text = input("Enter the name of the image : ")
imgurclient = ImgurClient(credentials)
items = imgurclient.gallery_search( q=f'{text}', advanced=None, sort='viral', window='all', page=0)
gallery = random.choice(items)
album = random.choice(imgurclient.get_album_images(gallery.id))
for img in album :
print(img.link)
Expected Output
to get the link of the image in an album
Traceback
File "pictures.py", line 77, in show for img in album : TypeError: 'Image' object is not iterable
My code
My Python Version And Environment
Python==3.8. Package Version
aiml 0.9.2 aiohttp 3.6.2 appdirs 1.4.3 astroid 2.3.3 async-timeout 3.0.1 asyncio 3.4.3 asyncpg 0.20.1 attrs 19.3.0 autopep8 1.5 beautifulsoup4 4.8.2 bs4 0.0.1 certifi 2019.11.28 cffi 1.13.2 chardet 3.0.4 colorama 0.4.3 datadog 0.33.0 datalog 0.7.8 decorator 4.4.1 discord.py 1.3.1 entrypoints 0.3 fake-useragent 0.1.11 flake8 3.7.9 future 0.18.2 idna 2.8 imgurpython 1.1.7 inflect 4.0.0 isort 4.3.21 jaraco.itertools 5.0.0 jedi 0.15.2 lazy-object-proxy 1.4.3 mccabe 0.6.1 more-itertools 8.2.0 multidict 4.7.4 numpy 1.18.1 pandas 1.0.0 parso 0.6.0 pip 20.0.2 pluggy 0.13.1 praw 6.5.1 prawcore 1.0.1 psutil 5.6.7 psycopg2 2.8.4 pycodestyle 2.5.0 pycparser 2.19 pydocstyle 5.0.2 pyflakes 2.1.1 pylint 2.4.4 PyNaCl 1.3.0 python-dateutil 2.8.1 python-jsonrpc-server 0.3.4 python-language-server 0.31.7 pytz 2019.3 PyYAML 5.3 recordclass 0.13.1 requests 2.22.0 rope 0.16.0 selenium 2.53.6 setuptools 41.2.0 six 1.14.0 snowballstemmer 2.0.0 soupsieve 1.9.5 Unidecode 1.1.1 update-checker 0.16 urllib3 1.25.8 vcrpy 4.0.2 websocket-client 0.57.0 websockets 8.1 wikipedia 1.4.0 wolframalpha 3.0.1 wrapt 1.11.2 xmltodict 0.12.0 yandex.translate 0.3.5 yapf 0.29.0 yarl 1.4.2 youtube-dl 2020.1.24