15
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu18.04でpip install mysqlclientするもエラーが出る場合の解決方法

Posted at

AWS EC2のUbuntu環境でmysqlを導入していたら、PythonとMySQLを接続するためのパッケージインストールでエラーが出まくったので色々調べて解決。

結論から言うと、CentOS同様にMySQLサーバだけでなく開発ツールを導入しなければいけないようです。

$ sudo apt-get install -y mysql-server
$ sudo apt-get install -y libmysqlclient-dev #←これ
$ pip install mysqlclient

これでいけました。

その他installしたけど関係あるかわからないもの

$ sudo apt-get install -y default-libmysqlclient-dev

環境

OS: Ubuntu18.04
pip 19.3.1

15
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?