我嘗試安裝MySQL客戶端的瓶子我得到一個錯誤,我使用python 3.4。我也嘗試使用pip安裝mysql安裝mysql相同的結果。 pip install flask-mysql
如果您有任何問題,請問我,我也嘗試升級車輪和設置工具,它仍然產生相同的結果。錯誤 - 無法安裝flask-mysql
控制檯:
Collecting flask-mysql
Using cached Flask_MySQL-1.3-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): Flask in c:\python34\l
ib\site-packages (from flask-mysql)
Collecting MySQL-python (from flask-mysql)
Using cached MySQL-python-1.2.5.zip
Requirement already satisfied (use --upgrade to upgrade): click>=2.0 in c:\pytho
n34\lib\site-packages (from Flask->flask-mysql)
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in c:\py
thon34\lib\site-packages (from Flask->flask-mysql)
Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in
c:\python34\lib\site-packages (from Flask->flask-mysql)
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in c:\pyth
on34\lib\site-packages (from Flask->flask-mysql)
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in c:\pytho
n34\lib\site-packages (from Jinja2>=2.4->Flask->flask-mysql)
Building wheels for collected packages: MySQL-python
Running setup.py bdist_wheel for MySQL-python ... error
Complete output from command c:\python34\python.exe -u -c "import setuptools,
tokenize;__file__='C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-build-z20yc1i6\\My
SQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\DELL\AppD
ata\Local\Temp\tmprw0gh6vepip-wheel- --python-tag cp34:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.4
copying _mysql_exceptions.py -> build\lib.win-amd64-3.4
creating build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.4\MySQLdb
creating build\lib.win-amd64-3.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.4\MySQLdb\const
ants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.4\MySQLdb\con
stants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.4\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.4\MySQLdb\consta
nts
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.4\MySQLdb\constan
ts
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\x86_amd64\cl.exe /c
/nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__version_
_=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -Ic:\py
thon34\include -Ic:\python34\include /Tc_mysql.c /Fobuild\temp.win-amd64-3.4\Rel
ease\_mysql.obj /Zl
_mysql.c
_mysql.c(42) : fatal error C1083: Impossibile aprire il file inclusione 'confi
g-win.h': No such file or directory
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin
\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for MySQL-python
Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python, flask-mysql
Running setup.py install for MySQL-python ... error
Complete output from command c:\python34\python.exe -u -c "import setuptools
, tokenize;__file__='C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-build-z20yc1i6\\
MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).r
ead().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\DELL\
AppData\Local\Temp\pip-2r3_b720-record\install-record.txt --single-version-exter
nally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.4
copying _mysql_exceptions.py -> build\lib.win-amd64-3.4
creating build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.4\MySQLdb
creating build\lib.win-amd64-3.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.4\MySQLdb\con
stants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.4\MySQLdb\c
onstants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.4\MySQLdb\constan
ts
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.4\MySQLdb\cons
tants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.4\MySQLdb\const
ants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\x86_amd64\cl.exe
/c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__versio
n__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -Ic:\
python34\include -Ic:\python34\include /Tc_mysql.c /Fobuild\temp.win-amd64-3.4\R
elease\_mysql.obj /Zl
_mysql.c
_mysql.c(42) : fatal error C1083: Impossibile aprire il file inclusione 'con
fig-win.h': No such file or directory
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\B
in\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\
\Users\\DELL\\AppData\\Local\\Temp\\pip-build-z20yc1i6\\MySQL-python\\setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\
n'), __file__, 'exec'))" install --record C:\Users\DELL\AppData\Local\Temp\pip-2
r3_b720-record\install-record.txt --single-version-externally-managed --compile"
failed with error code 1 in C:\Users\DELL\AppData\Local\Temp\pip-build-z20yc1i6
\MySQL-python\
看起來您的問題可能與未設置正確的Python開發環境有關。 http://stackoverflow.com/questions/18564745/cant-pip-install-mysql-python?rq=1 – jmetz