pip install - 選択したCPUはx86-64命令セットをサポートしません。

pip install - 選択したCPUはx86-64命令セットをサポートしません。

使ってみよう

pip install mysql-python

virtualenvコンテナ内でエラーが発生する

building '_mysql' extension

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1

_mysql.c:1:0: error: CPU you selected does not support x86-64 instruction set

error: command 'gcc' failed with exit status 1

-march=i68664ビットシステムで64ビットバージョンのPythonを使用していますが、gccがPythonを使用しようとしているのはなぜですか?

ベストアンサー1

環境変数を設定してスキーマを手動で設定できますCFLAGS

CFLAGS='-march=x86-64' pip install mysql-python

この変数の内容はgcc引数リストに追加されます。

おすすめ記事