pythonでMySQLdbを使おうとimportしたところ、_mysqlのimport時に下記のようなエラーが出てしまいました。
python
1import _mysql 2Traceback (most recent call last): 3 File "<stdin>", line 1, in <module> 4ImportError: dlopen(/Users/r.ikeda/.pyenv/versions/anaconda3-2.5.0/lib/python3.5/site-packages/MySQL_python-1.2.4-py3.5-macosx-10.5-x86_64.egg/_mysql.cpython-35m-darwin.so, 2): Library not loaded: libcrypto.1.0.0.dylib 5 Referenced from: /Users/r.ikeda/.pyenv/versions/anaconda3-2.5.0/lib/python3.5/site-packages/MySQL_python-1.2.4-py3.5-macosx-10.5-x86_64.egg/_mysql.cpython-35m-darwin.so 6 Reason: image not found
調べていくうちにopenssl関連のエラーだということがわかり、
Homebrewを使って最新版のopensslをインストールしたのですが、opensslのバージョンが上がってくれません。
bash
1$ openssl version 2OpenSSL 0.9.8zh 14 Jan 2016
また、リンクを通すコマンドは下記のように拒否されてしまいます。
bash
1brew link openssl --force 2Warning: Refusing to link: openssl 3Linking keg-only openssl means you may end up linking against the insecure, 4deprecated system OpenSSL while using the headers from Homebrew's openssl. 5Instead, pass the full include/library paths to your compiler e.g.: 6 -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
http://qiita.com/dasisyouyu/items/c9621c29b0fe79d2b7c4
上記の記事を参考に~/.bash_profileを下記のように書き換えましたが、効果はないようです。
export PYENV_ROOT=~/.pyenv export PATH=/usr/local/opt/openssl/lib:$PATH export PATH=$HOME/.nodebrew/current/bin:$PATH export PATH=/usr/local/bin:$PATH export PATH=$PATH:$PYENV_ROOT/bin export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS" export CPPFLAGS="-I/usr/local/opt/openssl/include $CPPFLAGS"
.zshrcや.zshenvを書き換えてパスの優先順位を変えるよう勧めているページも見つけましたが、そもそも私の環境に両ファイルはありません。
どのようにすればopensslを更新してmysqldbが利用できるようになるでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。