As the official API documentation says, wnid is the identification in ImageNet not nltk. You can map word to wnid according to the Mapping between ImageNet and WordNet in the API documentation.
To uniquely identify a synset, we use "WordNet ID" (wnid), which is a concatenation of POS ( i.e. part of speech ) and SYNSET OFFSET of WordNet.
Firstly, get synsets and offsets in nltk:
from nltk.corpus import wordnet as wn
plant_list = wn.synsets('plant')
# plant_list is: [Synset('plant.n.01'), Synset('plant.n.02'), Synset('plant.n.03'), Synset('plant.n.04'), Synset('plant.v.01'), Synset('implant.v.01'), Synset('establish.v.02'), Synset('plant.v.04'), Synset('plant.v.05'), Synset('plant.v.06')]
offset = plant_list[0].offset()
Secondly, concatenate the POS and offset
As the ImageNet only consider nouns, just pick the noun synsets in plant_list
and concatenate wnid = "n{:08d}".format(offset)
to get the wnid
.
Because there is a list of synsets, you will get several wnid
for 'plant'.