有错误"错误:命令' cl.exe'失败:没有这样的文件或目录"

时间:2017-01-24 22:47:04

标签: python mysql pip install cl.exe

尝试安装mysql-python

C:\Users\Одиночка>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:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\2871~1\\appdata\\local\\temp\\pip-build-lyj5ba\\mysql-python\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\2871~1\appdata\local\temp\pip-y0f9do-record\install-record.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\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\constants
    copying MySQLdb\constants\CR.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-2.7\MySQLdb\constants
    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\constants
    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
    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:\python27\include -Ic:\python27\PC /Tc_mysql.c /Fobuild\temp.win32-2.7\Release\_mysql.obj /Zl
    error: command 'cl.exe' failed: No such file or directory

1 个答案:

答案 0 :(得分:1)

我也遇到过这个问题。我尝试了互联网中列出的方法而不是工作。在计算机中安装带有cl.exe的Microsoft Visual Studio或添加C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ bin"对PATH。只是没有为我工作。然后,错误消息中间显示错误:

  

错误:命令' cl.exe'失败:没有这样的文件或目录
  .----------------------------------------失败的建筑轮   扭曲运行setup.py clean for Twisted Failed to build Twisted

它提到了Twisted,所以我先安装Twisted然后就可以了。 您可以在下面的链接中安装正确版本的Twisted: Unofficial Windows Binaries for Python Extension Packages