0

After running the pip install mysqlclient==1.3.8. I got the following error and have no idea what's wrong. Thanks in advance for any helps.

C:\GoogleCloud\python-flask>pip install mysqlclient==1.3.8
Collecting mysqlclient==1.3.8
  Using cached mysqlclient-1.3.8.tar.gz
Installing collected packages: mysqlclient
  Running setup.py install for mysqlclient ... error
    Complete output from command c:\python27\python.exe -u -c "import setuptools
, tokenize;__file__='c:\\users\\reo~1.bit\\appdata\\local\\temp\\pip-build-gv9rc
o\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.rea
d().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" insta
ll --record c:\users\reo~1.bit\appdata\local\temp\pip-ztpibg-record\install-reco
rd.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-2.7
    copying _mysql_exceptions.py -> build\lib.win32-2.7
    creating build\lib.win32-2.7\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\compat.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\release.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\times.py -> build\lib.win32-2.7\MySQLdb
    creating build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win32-2.7\MySQLdb\constan
ts
    copying MySQLdb\constants\CR.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-2.7\MySQLdb\const
ants
    copying MySQLdb\constants\ER.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\REFRESH.py -> build\lib.win32-2.7\MySQLdb\constant
s
    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-2.7\MySQLdb\constants

    running build_ext
    building '_mysql' extension
    creating build\temp.win32-2.7
    creating build\temp.win32-2.7\Release
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo
/Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,3,8,'final',1) -D__version__=1.3.8 "
-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -Ic:\python27\incl
ude -Ic:\python27\PC /Tc_mysql.c /Fobuild\temp.win32-2.7\Release\_mysql.obj /Zl
    _mysql.c
    _mysql.c(524) : error C2059: syntax error : '}'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BI
N\\cl.exe' failed with exit status 2

    ----------------------------------------

I'm newbie in python and want to learn python with flask + mysql. But this error occured. Can someone help ?

user3859812
  • 11
  • 1
  • 6
  • [Possibly related](https://stackoverflow.com/questions/36377777/python-error-command-microsoft-visual-studio-10-0-vc-bin-cl-exe-failed), see the comments for possible solutions. – Lomtrur Jun 05 '17 at 08:57
  • 1
    You're probably better installing a pre-built binary: [mysqlclient](http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient) – Peter Wood Jun 05 '17 at 08:59

0 Answers0