【发布时间】:2015-12-20 19:33:55
【问题描述】:
我一直在尝试通过运行 python setup.py install 来安装 pyodbc 3.0.7,但仍然遇到问题。目前我遇到了“错误:命令'cl.exe'失败:没有这样的文件或目录”墙。我在网上寻找的时间比我想承认的要弄清楚发生了什么的时间要长。
我使用的是 64 位版本的 Python 3.4
我有 Microsoft Visual Studio 10.0。
我已确认 vcvarsall.bat 位于 Program Files (x86)\Microsoft Visual Studio 10.0\VC 中。
我运行的是 64 位,所以我添加了 amd64 文件夹并将 vcvars64.bat 放在 Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64 中
我确认 cl.exe 位于 Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
我已经重新启动了我的计算机,以确保这不是问题所在。
但是当我尝试安装 pyodbc 时,我得到以下信息
C:\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7>python setup.py install
running install
running bdist_egg
running egg_info
writing pyodbc.egg-info\PKG-INFO
writing top-level names to pyodbc.egg-info\top_level.txt
writing dependency_links to pyodbc.egg-info\dependency_links.txt
reading manifest file 'pyodbc.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'tests\*'
writing manifest file 'pyodbc.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_ext
building 'pyodbc' extension
creating build
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
creating build\temp.win-amd64-3.4\Release\Users
creating build\temp.win-amd64-3.4\Release\Users\William
creating build\temp.win-amd64-3.4\Release\Users\William\Downloads
creating build\temp.win-amd64-3.4\Release\Users\William\Downloads\pyodbc-3.0.7
creating build\temp.win-amd64-3.4\Release\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7
creating build\temp.win-amd64-3.4\Release\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7\src
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DPYODBC_VERSION=3.0.7 -IC:\Python34\include -IC:\Python34\include /TpC:\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7\src\buffer.cpp /Fobuild\temp.win-amd64-3.4\Release\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7\src\buffer.obj /Wall /wd4668 /wd4820 /wd4711 /wd4100 /wd4127 /wd4191
error: command 'cl.exe' failed: No such file or directory
从那里,作为最后的努力,我尝试清理和构建,但遇到了同样的问题。
C:\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7>py -3 setup.py clean --all build_ext --force
running clean
removing 'build\temp.win-amd64-3.4' (and everything under it)
'build\lib.win-amd64-3.4' does not exist -- can't clean it
'build\bdist.win-amd64' does not exist -- can't clean it
'build\scripts-3.4' does not exist -- can't clean it
removing 'build'
running build_ext
building 'pyodbc' extension
creating build
creating build\temp.win-amd64-3.4
creating build\temp.win-amd64-3.4\Release
creating build\temp.win-amd64-3.4\Release\Users
creating build\temp.win-amd64-3.4\Release\Users\William
creating build\temp.win-amd64-3.4\Release\Users\William\Downloads
creating build\temp.win-amd64-3.4\Release\Users\William\Downloads\pyodbc-3.0.7
creating build\temp.win-amd64-3.4\Release\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7
creating build\temp.win-amd64-3.4\Release\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7\src
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DPYODBC_VERSION=3.0.7 -IC:\Python34\include -IC:\Python34\include /TpC:\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7\src\buffer.cpp /Fobuild\temp.win-amd64-3.4\Release\Users\William\Downloads\pyodbc-3.0.7\pyodbc-3.0.7\src\buffer.obj /Wall /wd4668 /wd4820 /wd4711 /wd4100 /wd4127 /wd4191
error: command 'cl.exe' failed: No such file or directory
我一直使用 pip,所以这不是我熟悉的东西,所以也许我做错了什么。任何帮助,我将永远感激不尽,因为我认为此时我已经用尽了所有资源。 (或者 pyodbc 3.0.7 的预构建副本也可以工作!)
【问题讨论】:
-
我刚刚删除了 Python 标签。原因很简单,Python 只是尝试调用
cl.exe(这是 Microsoft 编译器),但无论是谁调用它,它都不应该工作。所以,基本上,你的问题归结为你不能在命令行上运行cl.exe。
标签: visual-studio-2010 cl