Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I import COUNTRIES from pygal.i18n

I'm trying to import COUNTRIES from pygal.i18n by using the piece of code below.

     from pygal.i18n import COUNTRIES

After I run this, I get the following error.

    ImportError: No module named 'pygal.i18n'.

Can anyone tell me what the problem is?

Thanks

like image 761
RandomCoder Avatar asked Mar 03 '16 11:03

RandomCoder


1 Answers

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

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

from pygal.maps.world import COUNTRIES

Whats left of the i18n module can be imported with:

from pygal_maps_world import i18n
like image 192
mhawke Avatar answered Sep 19 '22 15:09

mhawke