nx.draw needs coordinates or a layout, then plt.show().
Goal
Draw four Kenya cities with fixed positions.
import networkx as nx
G = nx.Graph()
G.add_edges_from([('Nairobi', 'Nakuru'), ('Nakuru', 'Kisumu'), ('Nairobi', 'Mombasa')])
pos = {'Nairobi': (0, 0), 'Nakuru': (-1, 1), 'Kisumu': (-2, 0), 'Mombasa': (1.5, -1)}
nx.draw(G, pos, with_labels=True, node_color='#8ecae6', node_size=900)
plt.axis('off')
plt.show()
print(G.number_of_nodes())import networkx as nx
G = nx.cycle_graph(5)
nx.draw_circular(G, with_labels=True)
plt.show()
print('ok')