LoginSignup
8
6

More than 3 years have passed since last update.

MacOSでpip install mysqlclientが失敗する場合の対処

Last updated at Posted at 2019-11-20

失敗する原因はいくつかあります。
今回の対処方法は以下ができているのにまだ失敗する場合の対処方法です。

  • 最新のXcodeのコマンドラインツールがインストール済み
  • 最新のpipインストール済み
  • Mysqlインストール済み
  • OpenSSLインストール済み

上記問題ないのに下記のようなエラーが出ます。

    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command '/usr/bin/gcc' failed with exit status 1

この場合、下記の方法でインストールを実行するとインストールできました。

LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient     

via Can't install mysqlclient on MacOS · Issue #131 · PyMySQL/mysqlclient-python

8
6
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
8
6