2016-07-25 9 views
0

フラスコ - mysqlモジュールをインストールしようとしていて、エラーが発生しました。 vcvarsall.batに問題があるように見えますが、私は実際にそのようなことが分かっていません。フラスコ - mysqlのpythonモジュールのインストールでエラーが発生しました

自分よりも経験豊富なアイデアはありますか?

C:\eb-virt\bucketlist>pip install flask-mysql 

Collecting flask-mysql 
    Using cached Flask_MySQL-1.3-py2.py3-none-any.whl 
Collecting MySQL-python (from flask-mysql) 
    Using cached MySQL-python-1.2.5.zip 
Requirement already satisfied (use --upgrade to upgrade): Flask in c:\python27\lib\site-packages (from flask-mysql) 
Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in c:\python27\lib\site-packages (from Flask->flask-mysql) 
Requirement already satisfied (use --upgrade to upgrade): click>=2.0 in c:\python27\lib\site-packages (from Flask->flask-mysql) 
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in c:\python27\lib\site-packages (from Flask->flask-mysql) 
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in c:\python27\lib\site-packages (from Flask->flask-mysql) 
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in c:\python27\lib\site-packages (from Jinja2>=2.4->Flask->flask-mysql) 
Installing collected packages: MySQL-python, flask-mysql 
    Running setup.py install for MySQL-python ... error 
    Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\tonype~1\\appdata\\local\\temp\\pip-build-3xn7it\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\tonype~1\appdata\local\temp\pip-vtdlrx-record\install-record.txt --single-version-externally-managed --compile: 
    running install 
    running build 
    running build_py 
    creating build 
    creating build\lib.win-amd64-2.7 
    copying _mysql_exceptions.py -> build\lib.win-amd64-2.7 
    creating build\lib.win-amd64-2.7\MySQLdb 
    copying MySQLdb\__init__.py -> build\lib.win-amd64-2.7\MySQLdb 
    copying MySQLdb\converters.py -> build\lib.win-amd64-2.7\MySQLdb 
    copying MySQLdb\connections.py -> build\lib.win-amd64-2.7\MySQLdb 
    copying MySQLdb\cursors.py -> build\lib.win-amd64-2.7\MySQLdb 
    copying MySQLdb\release.py -> build\lib.win-amd64-2.7\MySQLdb 
    copying MySQLdb\times.py -> build\lib.win-amd64-2.7\MySQLdb 
    creating build\lib.win-amd64-2.7\MySQLdb\constants 
    copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-2.7\MySQLdb\constants 
    copying MySQLdb\constants\CR.py -> build\lib.win-amd64-2.7\MySQLdb\constants 
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-2.7\MySQLdb\constants 
    copying MySQLdb\constants\ER.py -> build\lib.win-amd64-2.7\MySQLdb\constants 
    copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-2.7\MySQLdb\constants 
    copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-2.7\MySQLdb\constants 
    copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-2.7\MySQLdb\constants 
    running build_ext 
    building '_mysql' extension 
    error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27 

    ---------------------------------------- 
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\tonype~1\\appdata\\local\\temp\\pip-build-3xn7it\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\tonype~1\appdata\local\temp\pip-vtdlrx-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\tonype~1\appdata\local\temp\pip-build-3xn7it\MySQL-python\ 
+0

ネイティブコードのコンパイルが必要です。あなたはVisual C++ 2008([別名VS 9.0](https://en.wikipedia.org/wiki/Visual_C%2B%2B#32-bit_and_64-bit_versions))のバージョンが必要です。これはPython 2.7自体と同じバージョンですでコンパイルされます。 Python 2.7モジュール専用のMicrosoftコンパイラがあります(こちらはhttps://www.microsoft.com/en-au/download/details.aspx?id=44266)。私はそれを試したことはありません。 –

+0

また、適切なmysql(x86 vs x64)をインストールしてください。 –

答えて

1

あなたはこれらのbinarieswindowsのためのディストリビューションを使用して試みることができます。 Flask-mysqlは、Windowsにインストールしようとするとissuesのmysql-pythonを使います。 thisを参照してください。あなたのpython 32ビットとMySQL またはその逆をインストールしたとき

+1

ありがとうございます!あなたの答えの最後のリンクは私の問題を解決:) – orangeandgrey

0

は、多くの場合、このタイプのエラーが発生しました。同じインストールを試してください。私はとこのエラーが発生しましたpostgresSqlとこのコマンドのpython ピップインストールpsycopg2 これはあなたの問題を解決することがあります。

関連する問題