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;错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Leetcode 234: Palindrome LinkedList(Leetcode 234:回文链接列表)
How do I read an Excel file directly from Dropbox#39;s API using pandas.read_excel()?(如何使用PANDAS.READ_EXCEL()直接从Dropbox的API读取Excel文件?)
subprocess.Popen tries to write to nonexistent pipe(子进程。打开尝试写入不存在的管道)
I want to realize Popen-code from Windows to Linux:(我想实现从Windows到Linux的POpen-code:)
Reading stdout from a subprocess in real time(实时读取子进程中的标准输出)
How to call type safely on a random file in Python?(如何在Python中安全地调用随机文件上的类型?)