Python3 解决 ModuleNotFoundError: No module named 'pygal.i18n' 问题

在获取国别码集通过导入模块pygal报以下问题:

from pygal.i18n import COUNTRIES 

解决方法:

安装模块

  pip3 install pygal_maps_world

from pygal_maps_world.i18n import COUNTRIES

for country_code in sorted(COUNTRIES.keys()):    print(country_code,COUNTRIES[country_code])

运行结果:

ad Andorra
ae United Arab Emirates
af Afghanistan
al Albania
am Armenia
ao Angola
aq Antarctica
ar Argentina
at Austria
au Australia
az Azerbaijan
ba Bosnia and Herzegovina
bd Bangladesh
be Belgium
bf Burkina Faso
bg Bulgaria
bh Bahrain
bi Burundi
bj Benin
bn Brunei Darussalam
bo Bolivia, Plurinational State of
br Brazil
bt Bhutan
bw Botswana
by Belarus
bz Belize
ca Canada
cd Congo, the Democratic Republic of the
cf Central African Republic
cg Congo
ch Switzerland
ci Cote d‘Ivoire
cl Chile
cm Cameroon
cn China
co Colombia
cr Costa Rica
cu Cuba
cv Cape Verde
cy Cyprus
cz Czech Republic
de Germany
dj Djibouti
dk Denmark
do Dominican Republic
dz Algeria
ec Ecuador
ee Estonia
eg Egypt
eh Western Sahara
er Eritrea
es Spain
et Ethiopia
fi Finland
fr France
ga Gabon
gb United Kingdom
ge Georgia
gf French Guiana
gh Ghana
gl Greenland
gm Gambia
gn Guinea
gq Equatorial Guinea
gr Greece
gt Guatemala
gu Guam
gw Guinea-Bissau
gy Guyana
hk Hong Kong
hn Honduras
hr Croatia
ht Haiti
hu Hungary
id Indonesia
ie Ireland
il Israel
in India
iq Iraq
ir Iran, Islamic Republic of
is Iceland
it Italy
jm Jamaica
jo Jordan
jp Japan
ke Kenya
kg Kyrgyzstan
kh Cambodia
kp Korea, Democratic People‘s Republic of
kr Korea, Republic of
kw Kuwait
kz Kazakhstan
la Lao People‘s Democratic Republic
lb Lebanon
li Liechtenstein
lk Sri Lanka
lr Liberia
ls Lesotho
lt Lithuania
lu Luxembourg
lv Latvia
ly Libyan Arab Jamahiriya
ma Morocco
mc Monaco
md Moldova, Republic of
me Montenegro
mg Madagascar
mk Macedonia, the former Yugoslav Republic of
ml Mali
mm Myanmar
mn Mongolia
mo Macao
mr Mauritania
mt Malta
mu Mauritius
mv Maldives
mw Malawi
mx Mexico
my Malaysia
mz Mozambique
na Namibia
ne Niger
ng Nigeria
ni Nicaragua
nl Netherlands
no Norway
np Nepal
nz New Zealand
om Oman
pa Panama
pe Peru
pg Papua New Guinea
ph Philippines
pk Pakistan
pl Poland
pr Puerto Rico
ps Palestine, State of
pt Portugal
py Paraguay
re Reunion
ro Romania
rs Serbia
ru Russian Federation
rw Rwanda
sa Saudi Arabia
sc Seychelles
sd Sudan
se Sweden
sg Singapore
sh Saint Helena, Ascension and Tristan da Cunha
si Slovenia
sk Slovakia
sl Sierra Leone
sm San Marino
sn Senegal
so Somalia
sr Suriname
st Sao Tome and Principe
sv El Salvador
sy Syrian Arab Republic
sz Swaziland
td Chad
tg Togo
th Thailand
tj Tajikistan
tl Timor-Leste
tm Turkmenistan
tn Tunisia
tr Turkey
tw Taiwan, Province of China
tz Tanzania, United Republic of
ua Ukraine
ug Uganda
us United States
uy Uruguay
uz Uzbekistan
va Holy See (Vatican City State)
ve Venezuela, Bolivarian Republic of
vn Viet Nam
ye Yemen
yt Mayotte
za South Africa
zm Zambia
zw Zimbabwe

Process finished with exit code 0

Python3 解决 ModuleNotFoundError: No module named 'pygal.i18n' 问题

原文地址:https://www.cnblogs.com/jerryspace/p/9963203.html

时间: 2024-11-04 10:23:47

Python3 解决 ModuleNotFoundError: No module named 'pygal.i18n' 问题的相关文章

解决 ModuleNotFoundError: No module named 'pip'

安装其它python包时,提示说 pip 10.0.1可用,就更新了一下,但是 更新过程中出现了错误,如图所示 因为这个错误导致 pip找不到, 可以首先执行  python -m ensurepip  然后执行 python -m pip install --upgrade pip  即可更新完毕. 如下图所示 解决 ModuleNotFoundError: No module named 'pip' 原文地址:https://www.cnblogs.com/wanghuaqiang/p/98

pip崩了, 解决 ModuleNotFoundError: No module named 'pip'.

今天 在windows下用pip 安装数据库模块pymysql  把pip 弄崩了,直接出现下面的错误.都是红字, 再输入pip install pymysql  ,会报错ModuleNotFoundError: No module named 'pip'. 类似于上图这种. 因为这个错误导致 pip找不到, 可以首先执行  python -m ensurepip  然后执行 python -m pip install --upgrade pip  即可更新完毕. 如下图所示 (over) pi

关于在centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named '_ctypes'的解决办法

3.7版本需要一个新的包libffi-devel,安装此包之后再次进行编译安装即可. #yum install libffi-devel -y#make install若在安装前移除了/usr/bin下python的文件链接依赖,此时yum无法正常使用,需要自己下载相关软件包安装,为节省读者时间,放上链接 #wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libffi-devel-3.0.13-18.el7.x86_64.rpm

命令行运行python项目文件,报错:ModuleNotFoundError: No module named 'xxxx' 解决办法

在pycharm中写好了自动化测试脚本,并能在pycharm中正常运行,由于要考虑到无人值守时能自动执行,执行时就需要脱离pycharm,直接能用命令执行.但是直接用命令执行用例文件:python3 D:\pycode\autotest_framework\case\run_case.py 结果报错,找不到模块 自动化项目的结构如下:用例run_case.py 和工具类utils下的工具 不在同一个文件夹下面.在脚本中需要导入包如: from utils.HTMLTestRunner impor

python3 引入selenium库报错ModuleNotFoundError: No module named 'selenium'

解决方法: pip install -U selenium python3 引入selenium库报错ModuleNotFoundError: No module named 'selenium' 原文地址:https://www.cnblogs.com/zouke1220/p/9326434.html

CentOS7.5 Python3安装pip报错:ModuleNotFoundError: No module named '_ctypes' --Python3

1.问题:pyhontModuleNotFoundError: No module named '_ctypes'  操作系统:CentOS7.5 安装完Pyhotn3后(如何安装Python3,安装后我的python.python3命令指向python3;python2命令和python2.7指向python2.7),发现没有安装两个版本都没有pip.所以下载好pip包,用系统自带python2安装如下所示: [root@VM_39_157_centos ~]# wget https://fi

python程序在命令行执行提示ModuleNotFoundError: No module named 'XXX' 解决方法

原文链接:https://www.cnblogs.com/dreamyu/p/7889959.html 在ide中执行python程序,都已经在默认的项目路径中,所以直接执行是没有问题的.但是在cmd中执行程序,所在路径是python的搜索路径,如果涉及到import引用就会报类似ImportError: No module named xxx这样的错误,解决方法: 在报错的模块中添加: import sys import os curPath = os.path.abspath(os.path

解决scrapy fetch http://www.csdn.net ModuleNotFoundError No module named 'win32api'

1.解决scrapy fetch http://www.csdn.netModuleNotFoundError No module named 'win32api' Python是没有自带访问windows系统API的库的,需要下载.库的名称叫pywin32,可以从网上直接下载. 以下链接地址可以下载:http://sourceforge.net/projects/pywin32/files%2Fpywin32/ (下载适合你的python版本) 解决scrapy fetch http://ww

centos7安装python3和Django后,ModuleNotFoundError: No module named '_sqlite3'

1.准备安装环境 yum groupinstall 'Development Tools' yum install zlib-devel bzip2-devel openssl-devel ncurses-devel 2.安装python3 去官网下载编译安装包或者直接执行以下命令下载 wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz 解压 tar -xvJf  Python-3.6.2.tar.xz 切换进入 cd