python提示ImportError: No module named mysql.connector

今天在centos7下Python版本2.7.5执行脚本提示缺少mysql模块

很简单执行yum install mysql-connector-python安装下模块即可

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
–> Running transaction check
—> Package mysql-connector-python.noarch 0:1.1.6-1.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================
Package Arch Version Repository Size
====================================================================================================================
Installing:
mysql-connector-python noarch 1.1.6-1.el7 epel 154 k

Transaction Summary
====================================================================================================================
Install 1 Package

Total download size: 154 k
Installed size: 636 k
Is this ok [y/d/N]: y
Downloading packages:
mysql-connector-python-1.1.6-1.el7.noarch.rpm | 154 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-connector-python-1.1.6-1.el7.noarch 1/1
Verifying : mysql-connector-python-1.1.6-1.el7.noarch 1/1

Installed:
mysql-connector-python.noarch 0:1.1.6-1.el7

Complete!

此条目发表在服务器分类目录,贴了标签。将固定链接加入收藏夹。

发表回复