###前提・実現したいこと
centos7でpythonモジュールのmysqlclientをインストールしたいのですが、エラーになります。
###該当のコマンド
# pip install mysqlclient 上記を実行すると下記が表示されました。 Collecting mysqlclient Using cached mysqlclient-1.3.9.tar.gz Installing collected packages: mysqlclient Running setup.py install for mysqlclient ... error Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-DthxI7/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-v86GTz-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/MySQLdb copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb copying MySQLdb/compat.py -> build/lib.linux-x86_64-2.7/MySQLdb copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb creating build/lib.linux-x86_64-2.7/MySQLdb/constants copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants running build_ext building '_mysql' extension creating build/temp.linux-x86_64-2.7 gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,3,9,'final',1) -D__version__=1.3.9 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o In file included from /usr/include/python2.7/pyconfig.h:6:0, from /usr/include/python2.7/Python.h:8, from _mysql.c:40: /usr/include/python2.7/pyconfig-64.h:1188:0: 警告: "_POSIX_C_SOURCE" が再定義されました [デフォルトで有効] #define _POSIX_C_SOURCE 200112L ^ In file included from /usr/include/sys/types.h:25:0, from /usr/include/mysql/mysql.h:49, from _mysql.c:30: /usr/include/features.h:168:0: 備考: ここが以前の宣言がある位置です # define _POSIX_C_SOURCE 200809L ^ In file included from /usr/include/python2.7/pyconfig.h:6:0, from /usr/include/python2.7/Python.h:8, from _mysql.c:40: /usr/include/python2.7/pyconfig-64.h:1210:0: 警告: "_XOPEN_SOURCE" が再定義されました [デフォルトで有効] #define _XOPEN_SOURCE 600 ^ In file included from /usr/include/sys/types.h:25:0, from /usr/include/mysql/mysql.h:49, from _mysql.c:30: /usr/include/features.h:170:0: 備考: ここが以前の宣言がある位置です # define _XOPEN_SOURCE 700 ^ gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib64 -L/usr/lib64 -lmysqlclient -lpthread -lz -lm -ldl -lssl -lcrypto -lpython2.7 -o build/lib.linux-x86_64-2.7/_mysql.so /usr/bin/ld: -lz が見つかりません /usr/bin/ld: -lssl が見つかりません /usr/bin/ld: -lcrypto が見つかりません collect2: エラー: ld はステータス 1 で終了しました error: command 'gcc' failed with exit status 1 ---------------------------------------- Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-DthxI7/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-v86GTz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-DthxI7/mysqlclient/
###補足情報(言語/FW/ツール等のバージョンなど)
CentOS Linux release 7.3.1611 (Core)
Python 2.7.5
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/04 06:13