2015-10-24 18 views
9

をインストールするときに、私はvirtualenvの中ジャンゴ1.8.5をインストールしてのpython 3.4.3 を使用して働いていたが、私はsqliteのエラー:コマンド 'x86_64版 - のlinux-gnuの-gccの' はmysqlclient

を使用しているとき、それはページの作品を表示しましたMySQLを使用していたと私は

pip install mysqlclient

を使用してはmysqlclientをインストールしようとしていると私は、次のメッセージ

---------------------------------------- 
Failed building wheel for mysqlclient 
Failed to build mysqlclient 
Installing collected packages: mysqlclient 
Running setup.py install for mysqlclient 
Complete output from command /home/sasidhar/django/env/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-5lj39q67/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-da2_35zs-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/sasidhar/django/env/include/site/python3.4/mysqlclient: 
running install 
running build 
running build_py 
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.4/MySQLdb 
running build_ext 
building '_mysql' extension 
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,3,6,'final',1) -D__version__=1.3.6 -I/usr/include/mysql -I/usr/include/python3.4m -I/home/sasidhar/django/env/include/python3.4m -c _mysql.c -o build/temp.linux-x86_64-3.4/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g -DNDEBUG 
_mysql.c:40:20: fatal error: Python.h: No such file or directory 
#include "Python.h" 
        ^
compilation terminated. 
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

---------------------------------------- 
Command "/home/sasidhar/django/env/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-5lj39q67/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-da2_35zs-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/sasidhar/django/env/include/site/python3.4/mysqlclient" failed with error code 1 in /tmp/pip-build-5lj39q67/mysqlclient 
を取得しています

私は図書館がerror: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

で提案されていると、まだ問題は私が
おかげでみんながこの問題を解決する助けてください 存続インストールしてみました!あなたがのpython3を使用しているので、

sudo apt-get install python-dev 

そして:

答えて

27

はあなたのpython-devをインストールする必要があり

sudo apt-get install python3-dev 

このコマンドはあなたを助ける必要があります。あなたはマックOSを使用している場合

あなたは試してみてください:

あなたは既にインストールされている醸造する必要が
brew update && brew rm python3 && brew install python3 

が、そうでない場合は、あなたがそれをインストールすることができます。 Mac OSでパッケージを入手するのに非常に便利です。 http://brew.sh/ python3.5を使用してそれらのために

+0

@sasidharうん、あなたは – Paul

+0

'apt-getののpython3-devのインストールはsudo' を使用することができます私はほとんど昨日 6時間のためにそれを試してみましたあなたは非常に多くの先生に感謝私も 'sudoののpython3-dev' をインストールapt-getののpython-devのが、 をインストールトリック –

+0

は、あなたが今のMySQL DB :)とジャンゴを実行している私の一日:) を作っ もう一度ありがとうございますでした) –

4

apt-get install python3.5-dev 
wget https://bootstrap.pypa.io/get-pip.py 
python3.5 get-pip.py 
pip3.5 install mysqlclient 
関連する問題