7
3

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 5 years have passed since last update.

python mysqlclientのインストールがエラーになる場合の対処(mac)

Last updated at Posted at 2019-01-01

#pythonのmysqlclientがエラーになる場合の対処
python用MySQLコネクタのmysqlclientのインストール時にエラーが複数でて泣きそうになったので対処の記載です。

##環境

  • macOS Mojave 10.14.2
  • python 3.7.1
  • pip 18.1
  • mysqlclient 1.3.14

pip install mysqlclient
で複数のエラー発生

##invalid active developer path (/Library/Developer/CommandLineTools)

xcode-select --install
でCommandLineToolsを導入することで対処できます。
##'my_config.h' file not found

brew install mysql-connector-c mysql-connector-cをインストール
which mysql_config でmysql_configのパスを確認
chmod 777 上記のパスで権限を書込可能に変更
vim 上記のパス
libs="$libs -l"libs="$libs -lmysqlclient -lssl -lcrypto"に変更します。

##参考文献
https://stackoverflow.com/questions/50940302/installing-mysql-python-causes-command-clang-failed-with-exit-status-1-on-mac

7
3
2

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
7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?