我一直在尝试通过运行 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.0VC 中。
我正在运行 64 位,所以我添加了 amd64 文件夹并将 vcvars64.bat 放入 Program Files (x86)Microsoft Visual Studio 10.0VCbinamd64
我确认 cl.exe 在 Program Files (x86)Microsoft Visual Studio 10.0VCbin 中
我重新启动计算机只是为了确保这不是问题所在。
但是当我尝试安装 pyodbc 时,我得到以下信息
C:UsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7>python setup.py install
running install
running bdist_egg
running egg_info
writing pyodbc.egg-infoPKG-INFO
writing top-level names to pyodbc.egg-infotop_level.txt
writing dependency_links to pyodbc.egg-infodependency_links.txt
reading manifest file 'pyodbc.egg-infoSOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'tests*'
writing manifest file 'pyodbc.egg-infoSOURCES.txt'
installing library code to buildbdist.win-amd64egg
running install_lib
running build_ext
building 'pyodbc' extension
creating build
creating buildtemp.win-amd64-3.4
creating buildtemp.win-amd64-3.4Release
creating buildtemp.win-amd64-3.4ReleaseUsers
creating buildtemp.win-amd64-3.4ReleaseUsersWilliam
creating buildtemp.win-amd64-3.4ReleaseUsersWilliamDownloads
creating buildtemp.win-amd64-3.4ReleaseUsersWilliamDownloadspyodbc-3.0.7
creating buildtemp.win-amd64-3.4ReleaseUsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7
creating buildtemp.win-amd64-3.4ReleaseUsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7src
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DPYODBC_VERSION=3.0.7 -IC:Python34include -IC:Python34include /TpC:UsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7srcbuffer.cpp /Fobuildtemp.win-amd64-3.4ReleaseUsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7srcbuffer.obj /Wall /wd4668 /wd4820 /wd4711 /wd4100 /wd4127 /wd4191
error: command 'cl.exe' failed: No such file or directory
从那里,作为最后的努力,我试图清理和建造,但遇到了同样的问题。
C:UsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7>py -3 setup.py clean --all build_ext --force
running clean
removing 'buildtemp.win-amd64-3.4' (and everything under it)
'buildlib.win-amd64-3.4' does not exist -- can't clean it
'buildbdist.win-amd64' does not exist -- can't clean it
'buildscripts-3.4' does not exist -- can't clean it
removing 'build'
running build_ext
building 'pyodbc' extension
creating build
creating buildtemp.win-amd64-3.4
creating buildtemp.win-amd64-3.4Release
creating buildtemp.win-amd64-3.4ReleaseUsers
creating buildtemp.win-amd64-3.4ReleaseUsersWilliam
creating buildtemp.win-amd64-3.4ReleaseUsersWilliamDownloads
creating buildtemp.win-amd64-3.4ReleaseUsersWilliamDownloadspyodbc-3.0.7
creating buildtemp.win-amd64-3.4ReleaseUsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7
creating buildtemp.win-amd64-3.4ReleaseUsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7src
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DPYODBC_VERSION=3.0.7 -IC:Python34include -IC:Python34include /TpC:UsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7srcbuffer.cpp /Fobuildtemp.win-amd64-3.4ReleaseUsersWilliamDownloadspyodbc-3.0.7pyodbc-3.0.7srcbuffer.obj /Wall /wd4668 /wd4820 /wd4711 /wd4100 /wd4127 /wd4191
error: command 'cl.exe' failed: No such file or directory
我一直使用 pip 所以这不是我熟悉的东西所以也许我做错了什么。任何帮助,我将永远感激不尽,因为我认为此时我已经用尽了所有资源。 (或者 pyodbc 3.0.7 的预建副本也可以工作!)
您可能尝试从默认的
Command Prompt
构建。这不起作用。您必须准备一个
Command Prompt
。我使用以下命令来获取具有正确设置的命令行:您可以在桌面上创建一个新的快捷方式,以便在安装新的 python 模块时不必键入它。
现在您可以运行一个新的
Command Prompt
并构建一个Python
包。