python从入门到实践的世界地图部分,输出的图片没有交互性请问这是怎么回事?

import json
from pygal_maps_world.i18n import COUNTRIES
import pygal
import pygal_maps_world.maps

filename='population_data.json'

def get_country_code(country_name):
for code,name in COUNTRIES.items():
if name==country_name:
return code

with open(filename) as f:
pop_data=json.load(f)

cc_populations={}
for pop_dict in pop_data:
if pop_dict['Year']=='2010':
country_name=pop_dict['Country Name']
population=int(float(pop_dict['Value']))
# print(country_name+": "+ str(population))
code=get_country_code(country_name)
if code:
cc_populations[code]=population

wm=pygal_maps_world.maps.World()
wm.title='World Population in 2010,by Country'
wm.add('2010',cc_populations)
wm.render_to_file('world_population.svg')

print('countof items = ' + str(len(pop_data)) )

for country_code in sorted(COUNTRIES.keys()):

print(country_code,COUNTRIES[country_code])

可能是书本 15.4.1安装Pygal 中介绍的安装语句安装的Pygal版本太老,和目前所用的python版本不兼容。还有可能是浏览器的问题。
更新Pygal看一下

pip install --upgrade pygal