我需要在Windows 10上为python安装mysqldb,我尝试了以下方法,但我得到了同样的错误:安装脚本退出并显示错误:command' cl.exe'失败:没有这样的文件或目录
pip install mysqlclinet,easy_instal mysql-python
请帮忙!
error: command 'cl.exe' failed: No such file or directory
E:\Python\Django-PyCharm\DjangoPyCharmWeb>easy_install mysqlclient
Searching for mysqlclient
Reading https://pypi.python.org/simple/mysqlclient/
Downloading https://pypi.python.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.1
2.tar.gz#md5=dbf1716e2c01966afec0198d75ce7e69
Best match: mysqlclient 1.3.12
Processing mysqlclient-1.3.12.tar.gz
Writing C:\Users\Hoshmand\AppData\Local\Temp\easy_install-4ln2fjka\mysqlclient-1.3.12\setup.cfg
Running mysqlclient-1.3.12\setup.py -q bdist_egg --dist-dir C:\Users\me\AppData\Local\Temp\easy_install-4ln2fjka\mysqlclien
t-1.3.12\egg-dist-tmp-aeu8iq_w
error: Setup script exited with error: command 'cl.exe' failed: No such file or directory
E:\Python\Django-PyCharm\DjangoPyCharmWeb>
C:\Users\me\Downloads\mysqlclient-1.3.12>python setup.py build
running build
running build_py
creating build
creating build\lib.win32-3.6
copying _mysql_exceptions.py -> build\lib.win32-3.6
creating build\lib.win32-3.6\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.6\MySQLdb
creating build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.6\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-3.6
creating build\temp.win32-3.6\Release
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,12,'final',0) -D__version__=1.3.12 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -IC:\Python\Python36\include -IC:\Python\Python36\include /Tc_mysql.c /Fobuild\temp.win32-3.6\Release\_mysql.obj /Zl
error: command 'cl.exe' failed: No such file or directory

答案 0 :(得分:0)
找不到C ++库。 检查链接:https://github.com/pygraphviz/pygraphviz/issues/145
答案 1 :(得分:0)
尝试使用saveChanges() {
// ... Do what you have to do then
this.router.navigate(['/login']);
}
代替pip
。这样它应该安装easy_install
而不是从源代码构建。
wheel