Microsoft Visual C++…(&Q)尝试在Windows上安装pyodbc时需要"错误

quot;Microsoft Visual C++ … is requiredquot; error when trying to install pyodbc on Windows(Microsoft Visual C++…(Q)尝试在Windows上安装pyodbc时需要quot;错误)

本文介绍了Microsoft Visual C++…(&Q)尝试在Windows上安装pyodbc时需要"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装pyodbc,但出现以下错误。

C:PythonPython37Scripts>pip3 install pyodbc

输出

Collecting pyodbc
  Using cached https://files.pythonhosted.org/packages/aa/71/cef225c4889620a1a00251d24c1746fe0cf4124290a75d1c2dc5c187b61f/pyodbc-4.0.23.tar.gz
Installing collected packages: pyodbc
  Running setup.py install for pyodbc ... error
    Complete output from command c:pythonpython37python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Alankar\AppData\Local\Temp\pip-install-7qf14pkz\pyodbc\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersAlankarAppDataLocalTemppip-record-k11gmg0xinstall-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'pyodbc' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

Command "c:pythonpython37python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\Alankar\AppData\Local\Temp\pip-install-7qf14pkz\pyodbc\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersAlankarAppDataLocalTemppip-record-k11gmg0xinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:UsersAlankarAppDataLocalTemppip-install-7qf14pkzpyodbc

推荐答案

我无法使C++生成工具方法工作,但我发现此方法非常简单:

  1. 根据您的计算机架构和版本下载相应的pyodbc车轮(预编译二进制文件):https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
  2. 运行pip install <wheel path>

例如:

pip install c:usersobdownloadspyodbc-4.0.27-cp38-cp38-win_amd64.whl

这篇关于Microsoft Visual C++…(&Q)尝试在Windows上安装pyodbc时需要&quot;错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Microsoft Visual C++…(&Q)尝试在Windows上安装pyodbc时需要&quot;错误

基础教程推荐