PyMySQL 的安装 | 珊瑚贝

在 Python3 中如果想要将数据存储到 MySQL 中就需要借助于 PyMySQL 来操作,本节我们介绍一下 PyMySQL 的安装方式。

相关链接

安装方法

pip 安装

推荐使用 pip3 安装,命令如下:

1
pip3 install pymysql

执行完命令即可完成安装。

验证安装

为了验证库是否已经安装成功,可以在命令行下测试一下:

1
2
3
4
5
$ python3
>>> import pymysql
>>> pymysql.VERSION
(1, 0, 2, None)
>>>

在命令行首先输入 python3,进入命令行模式,输入如上内容,如果成功输出了其版本内容,那么证明 PyMySQL 成功安装。

来源:https://cuiqingcai.com/31041.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_11530.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?