Unable to import COUNTRIES from pygal.i18n

I'm trying to

from pygal.i18 import COUNTRIES 

but all i get is

 ImportError: No module named 'pygal.i18n'. 

Can someone tell me what the problem is?

thanks

+8
python import pygal
source share
1 answer

The i18n module was removed in pygal-2.0.0, however now it can be found in the pygal_maps_world plugin.

You can install this with pip install pygal_maps_world . Then you can access COUNTRIES as pygal.maps.world.COUNTRIES :

 from pygal.maps.world import COUNTRIES 

The rest of the i18n module can be imported using:

 from pygal_maps_world import i18n 
+10
source share

All Articles