python-igraph Raise ValueError: iterable must yield numbers when I used write_gml

I often raise a ValueError for function write_gml, after I add some new vertices in constructed graph object. However, It works when I replace it for write_graphml. What can I do for solving this problem.

Can you show a complete minimal example that illustrates the problem? See for guidance.

Thanks for your reply. The minimal example following:

import igraph
g = ssn.subgraph(cc) # ssn is a already constructed graph, cc represents ssn's component. 
nodes =, genesNum_gt=1) # genesNum: a node attribution
for node in nodes:
      names = node['name'].split(' ')
      for name in names:
raise ValueError: iterable must yield numbers

Can you please show a complete (but still minimal) example? This one relies on data that only you have.