错误:命令“cl.exe"失败:没有这样的文件或目录 [英] error: command 'cl.exe' failed: No such file or directory
问题描述
我目前正在尝试通过 pip 安装 PYODBC,但出现错误.在这一点上,我不知道该怎么做.
这是它的样子:
I am currently trying to install PYODBC via pip but am getting an error. at this point, I am at a loss on what to do.
Here is what it looks like:
C:\Users\c.ginther>pip install pyodbc
Collecting pyodbc
Using cached pyodbc-3.0.10.tar.gz
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command "c:\program files\python35\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\CB9EB~1.GIN\\AppData\\Local\\Temp\\pip-build-mdyxyolm\\pyodbc\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\CB9EB~1.GIN\AppData\Local\Temp\pip-ag94eyey-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\Users
creating build\temp.win-amd64-3.5\Release\Users\CB9EB~1.GIN
creating build\temp.win-amd64-3.5\Release\Users\CB9EB~1.GIN\AppData
creating build\temp.win-amd64-3.5\Release\Users\CB9EB~1.GIN\AppData\Local
creating build\temp.win-amd64-3.5\Release\Users\CB9EB~1.GIN\AppData\Local\Temp
creating build\temp.win-amd64-3.5\Release\Users\CB9EB~1.GIN\AppData\Local\Temp\pip-build-mdyxyolm
creating build\temp.win-amd64-3.5\Release\Users\CB9EB~1.GIN\AppData\Local\Temp\pip-build-mdyxyolm\pyodbc
creating build\temp.win-amd64-3.5\Release\Users\CB9EB~1.GIN\AppData\Local\Temp\pip-build-mdyxyolm\pyodbc\src
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYODBC_VERSION=3.0.10 -DPYODBC_UNICODE_WIDTH=2 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include "-Ic:\program files\python35\include" "-Ic:\program files\python35\include" /EHsc /TpC:\Users\CB9EB~1.GIN\AppData\Local\Temp\pip-build-mdyxyolm\pyodbc\src\buffer.cpp /Fobuild\temp.win-amd64-3.5\Release\Users\CB9EB~1.GIN\AppData\Local\Temp\pip-build-mdyxyolm\pyodbc\src\buffer.obj /Wall /wd4668 /wd4820 /wd4711 /wd4100 /wd4127 /wd4191
error: command 'cl.exe' failed: No such file or directory
推荐答案
正如 user590028 在评论中提到的,python 需要一个 C 编译器来安装像 pyodbc 这样的包.在 Windows 上,最常见的编译器是 Visual Studio C++,因此请查看以下取自 适用于 Python 3.4 的 Microsoft Visual C++ 编译器
As user590028 mentioned in the comments python requires a C compiler to install packages like pyodbc. On Windows the most common compiler is Visual Studio C++, so check the list below taken from Microsoft Visual C++ Compiler for Python 3.4
- 适用于 Python 2.7 的 Visual Studio 2008.
- 适用于 Python 3.4 的 Visual Studio 2010.
较新版本的 Visual Studio 应该可以在 Python 3.5 上运行.
Newer versions of Visual Studio should work on Python 3.5.
如果你安装了 Visual Studio,你应该能够在没有任何错误的情况下构建 pyodbc.
If you install Visual Studio you should be able to build pyodbc without any errors.
这篇关于错误:命令“cl.exe"失败:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!