There are 2 similarly named packages:
You can check each package's PyPi and Github page to confirm which one you need.
But it seems what you are looking for is the iso-639
package (with the hyphen). Because its __init.py__
file has an importable languages
module:
"""
Python library for ISO 639 standard
Copyright (c) 2014-2016 Mikael Karlsson (CSC - IT Center for Science Ltd.).
Licensed under AGPLv3.
"""
from __future__ import absolute_import
from iso639.iso639 import Iso639
__version__ = '0.4.5'
languages = Iso639()
So make sure to install iso-639
$ python3 -m pip install iso-639
...
Installing collected packages: iso-639
Successfully installed iso-639-0.4.5
$ python3
...
>>> import iso639
>>> dir(iso639)
[... 'iso639', 'languages']
>>> from iso639 import languages
>>>
(Make sure to uninstall the other one, because both are imported as from iso639
).