---
title: "Ubuntu 14.04 Install mysqlclient for Python2.7"
author: "Rule"
date: "2016-02-13T20:42:45Z"
tags: []
categories: ["操作系统"]
slug: "ubuntu-14-04-install-mysqlclient-for-python2-7"
draft: false
lastmod: "2016-02-13T21:05:26Z"
id: 2276293
url: "https://rule.iteye.com/blog/2276293"
---

Ubuntu14.04系统Python默认版本是2.7.6

pip升级后通过pip安装一些python包时报如下两个告警（SNIMissingWarning和InsecurePlatformWarning），其实是SSL的问题，urllib3需要pyopenssl 

1.首先安装mysql server，见：http://rule.iteye.com/admin/blogs/2276278

2.安装依赖

sudo apt-get install python-dev libmysqlclient-dev

3.安装mysqlclient驱动

sudo pip install mysqlclient

*报SNIMissingWarning和InsecurePlatformWarning告警*

4.通过安装pyopenssl等依赖包解决这两个告警问题

sudo apt-get install libffi-dev libssl-dev

pip install cryptography

pip install pyopenssl ndg-httpsclient pyasn1

参考：https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning