Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no module named pycountry

Tags:

python

module

Attempting to import and use pycountry in python 2.7.

import pycountry
len(pycountry.countries)

However, module is not recognised.

Traceback (most recent call last):       
File "countries_list.py", line 1, in <module>                                    
import pycountry                     
ImportError: No module named pycountry
like image 484
koopertrooper Avatar asked Mar 09 '23 02:03

koopertrooper


1 Answers

You have to install it using pip.

pip install pycountry

And then you can use it :)

like image 173
Víctor López Avatar answered Mar 16 '23 14:03

Víctor López