2016-05-10 6 views
1

私はこれを動作させようとしましたが、成功しませんでした。OSXでmysql-pythonを完全にインストール

pip install mysql-python 

を私はいつも、私はすべてのライブラリを更新するために自作を使用しているこのエラー

clang: error: invalid version number in '-mmacosx-version-min=10.11' 
error: command 'clang' failed with exit status 1 

を取得し、私はすでにMySQLをインストールしている:私は実行してmysql-pythonをインストールしようとしています。また、最新のpip、xcode、xcodeコマンドラインツールを用意しました。

数時間は検索しましたが、このパッケージを構築する方法が見つかりませんでした。

誰かが同様の状況に遭遇した場合は、私は非常に少しの指導に感謝します。

Collecting mysql-python 
Using cached MySQL-python-1.2.5.zip 
Building wheels for collected packages: mysql-python 
Running setup.py bdist_wheel for mysql-python ... error 
Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/qh/38cj02sj1fb83lfnsd4x3jm40000gn/T/pip-build-lCuswO/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/qh/38cj02sj1fb83lfnsd4x3jm40000gn/T/tmpFVHSn1pip-wheel- --python-tag cp27: 
running bdist_wheel 
running build 
running build_py 
creating build 
creating build/lib.macosx-10.11-x86_64-2.7 
copying _mysql_exceptions.py -> build/lib.macosx-10.11-x86_64-2.7 
creating build/lib.macosx-10.11-x86_64-2.7/MySQLdb 
copying MySQLdb/__init__.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb 
copying MySQLdb/converters.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb 
copying MySQLdb/connections.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb 
copying MySQLdb/cursors.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb 
copying MySQLdb/release.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb 
copying MySQLdb/times.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb 
creating build/lib.macosx-10.11-x86_64-2.7/MySQLdb/constants 
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb/constants 
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb/constants 
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb/constants 
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb/constants 
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb/constants 
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb/constants 
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.11-x86_64-2.7/MySQLdb/constants 
running build_ext 
building '_mysql' extension 
creating build/temp.macosx-10.11-x86_64-2.7 
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/5.7.12/include/mysql -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.11-x86_64-2.7/_mysql.o -fno-omit-frame-pointer 
clang: error: invalid version number in '-mmacosx-version-min=10.11' 
error: command 'clang' failed with exit status 1 
+0

使用しているOSXのバージョンは何ですか? –

+0

エルキャピタン10.11.4 –

+0

完全なトレースバックを投稿できますか? –

答えて

0

あなたは、最初の自作を通じてMySQLをインストールする必要がありますOS X上で正しくのpython-mysqlの仕事を得るために

pip uninstall MySQL-python 
brew install mysql 
brew install mysql-connector-c 
pip install MySQL-python 

オリジナルの答え:MySQL-python on mac

+0

こんにちは!あなたの応答に感謝します。私はすでにそれらをした、運がない。それでも同じエラーが出ます。 –

+0

私は編集されたバージョンを試しましたが、まだ良くありません。私はそのclangエラーを取得し続けます。あなたの助けをありがとう。 他のアイデアはありますか?事前に感謝します –

+0

試した[this](http://stackoverflow.com/questions/22413050/cant-install-python-mysql-library-on-mac-mavericks)? Alse check [this](http://stackoverflow.com/a/22697917/2142994)。 –

3

このX-コードではないためであるかもしれませんインストール済み

xcode-select --install 
+0

この文字コードを使用してくださいがインストールされています: sudo xcode-select --reset – rahulthakur319

関連する問題