DEV Community

Discussion on: NFT images generator using Python Jupyter Notebook

 
victorquanlam profile image
Victor Quan Lam

oh I think it supposed to be for i in data instead of for i in metada

Thread Thread
 
cstavr1 profile image
cstavr

Similar error but now as below....do I need a folder also called data and if so where does that reside?
139 "value": value
140 }
--> 141 for i in data:
142 token_id = i['tokenId']
143 token = {

NameError: name 'data' is not defined

Thread Thread
 
cstavr1 profile image
cstavr

This seems to be the area where it is failing

for i in data:
token_id = i['tokenId']
token = {
"image": IMAGES_BASE_URI + str(token_id) + '.png',
"tokenId": token_id,
"name": PROJECT_NAME + ' ' + str(token_id),
"attributes": []
}

Thread Thread
 
cstavr1 profile image
cstavr

Oddly enough I ran this again today and now a new error:

C:\Users\CHRIS~1.STA\AppData\Local\Temp/ipykernel_27868/3811645234.py in
139 "value": value
140 }
--> 141 for i in data:
142 token_id = i['tokenId']
143 token = {

TypeError: 'function' object is not iterable

Thread Thread
 
victorquanlam profile image
Victor Quan Lam

hmm strange. I haven't got any problem like this.
Check the source code out. Hope it helps
github.com/victorquanlam/nft-creator