が窓

2016-04-03 7 views
0

上のMySQL-pythonのインストールPIP PIPウィンドウ10上のMySQL-pythonのインストール私が得た:が窓

C:\Users\ghina>pip install MySQL-python 
Collecting MySQL-python 
    Using cached MySQL-python-1.2.5.zip 
Installing collected packages: MySQL-python 
    Running setup.py install for MySQL-python ... error 
    Complete output from command c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ghina\\AppData\\Local\\Temp\\pip-build-eo59erqx\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ghina\AppData\Local\Temp\pip-b4pe3d_p-record\install-record.txt --single-version-externally-managed --compile: 
    running install 
    running build 
    running build_py 
    creating build 
    creating build\lib.win-amd64-3.5 
    copying _mysql_exceptions.py -> build\lib.win-amd64-3.5 
    creating build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\__init__.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\converters.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\cursors.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\release.py -> build\lib.win-amd64-3.5\MySQLdb 
    copying MySQLdb\times.py -> build\lib.win-amd64-3.5\MySQLdb 
    creating build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.5\MySQLdb\constants 
    running build_ext 
    building '_mysql' extension 
    error: Unable to find vcvarsall.bat 

    ---------------------------------------- 
Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ghina\\AppData\\Local\\Temp\\pip-build-eo59erqx\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ghina\AppData\Local\Temp\pip-b4pe3d_p-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ghina\AppData\Local\Temp\pip-build-eo59erqx\MySQL-python\ 

私のpython 3.5を使用してWindows 10上だと1.9ジャンゴ、そして私がしたいですmysqlデータベースにdjangoを接続します。私がdjangoサーバを実行すると、「MySQLbd」というモジュールはありません

+0

python 3.xの代替手段は何ですか? – ghina

答えて

2

MySQL-PythonはPython 3.xをサポートしていません。公式Django documentationによると、あなたは、次のいずれかのドライバを使用することができます。

ザ・パイソンのデータベースAPIはPEP 249に記述されているMySQLは、このAPIを実装する3人の著名なドライバーを持っています

MySQLdbは、ネイティブドライバでありますAndy Dustmanによって十年にわたって のために開発され、サポートされています。

mysqlclientは、 が特にPython 3をサポートしており、 MySQLdbのドロップイン置換として使用できるMySQLdbのフォークです。この記事の執筆時点では、DjangoでMySQLを使用する場合には をお勧めします。

MySQL Connector/Pythonは、MySQLクライアントライブラリを必要としない純粋なPython ドライバ、または標準ライブラリ以外のPythonモジュール です。