[Python3 网络爬虫开发实战] 1.5.1-PyMySQL 的安装 | 珊瑚贝

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

1. 相关链接

2. pip 安装

这里推荐使用 pip 安装,命令如下:

1
pip3 install pymysql

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

3. 验证安装

为了验证库是否已经安装成功,可以在命令行下测试一下。这里首先输入 python3,进入命令行模式,接着输入如下内容:

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

如果成功输出了其版本内容,那么证明 PyMySQL 成功安装。

来源:https://cuiqingcai.com/5227.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_11463.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?