gpt4 book ai didi

python - 需要 Microsoft Visual C++ 10.0。通过 "Microsoft Windows SDK 7.1": www. microsoft.com/download/details.aspx?id=8279 获取

转载 作者:行者123 更新时间:2023-11-29 10:39:31 25 4
gpt4 key购买 nike

** 需要 Microsoft Visual C++ 10.0。通过“Microsoft Windows SDK 7.1”获取:www.microsoft.com/download/details.aspx?id=8279**

我在安装 mysqlclient 或 mysql-python 时收到此错误

通过pip安装mysqlclient

我已经更新了所有内容,并且没有使用任何使用 Sublime Text 的 Visual Studio 产品,请帮助我!

最佳答案

我想测试我在评论中所说的是否属实,因此我尝试在我的 Python 2.7 之一中pip installMySQLClient。 13 (VEnv) 安装:

e:\Work\Dev\VEnvs\py2713x64-test>Scripts\pip.exe install -v mysqlclient
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Config variable 'Py_UNICODE_SIZE' is unset, Python ABI tag may be incorrect
Collecting mysqlclient
1 location(s) to search for versions of mysqlclient:
* https://pypi.python.org/simple/mysqlclient/
Getting page https://pypi.python.org/simple/mysqlclient/
Looking up "https://pypi.python.org/simple/mysqlclient/" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
"GET /simple/mysqlclient/ HTTP/1.1" 200 2671
Updating cache with response from
"https://pypi.python.org/simple/mysqlclient/"
Caching b/c date exists and max-age > 0
Analyzing links from page https://pypi.python.org/simple/mysqlclient/

# @TODO - cfati: Truncated output

No cache entry available
"GET /packages/40/9b/0bc869f290b8f49a99b8d97927f57126a5d1befcf8bac92c60dc855f2523/mysqlclient-1.3.10.tar.gz HTTP/1.1" 200 82102
Downloading mysqlclient-1.3.10.tar.gz (82kB)
Downloading from URL https://pypi.python.org/packages/40/9b/0bc869f290b8f49a99b8d97927f57126a5d1befcf8bac92c60dc855f2523/mysqlclient-1.3.10.tar.gz#md5=e7fb95c4055e2d8a3322db5c85ab6fc8 (from https://pypi.python.org/simple/mysqlclient/)
99% |############################### | 81kB 252kB/s eta 0:00:01 Updating cache with response from "https://pypi.python.org/packages/40/9b/0bc869f290b8f49a99b8d97927f57126a5d1befcf8bac92c60dc855f2523/mysqlclient-1.3.10.tar.gz"

# @TODO - cfati: Truncated output

running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
error
Failed building wheel for mysqlclient

发生了什么:

  • 它连接到 [PyPI]: Links for mysqlclient

  • 它检查最新版本:v1.3.10(在应答时)

  • 由于此版本仅针对 Python 3.5Python 3.6 编译(064bit/032bit ):

    • mysqlclient-1.3.10-cp35-cp35m-win32.whl

    • mysqlclient-1.3.10-cp35-cp35m-win_amd64.whl

    • mysqlclient-1.3.10-cp36-cp36m-win32.whl

    • mysqlclient-1.3.10-cp36-cp36m-win_amd64.whl

  • 它下载源存档:mysqlclient-1.3.10.tar.gz

  • 存档包含(除了Python文件、安装文件和其他附加文件)一个文件:_mysql.c,它是用于与MySQL。正如我所说,为了使用 C 代码,必须将其编译为 .dll (_mysql.pyd)。有关构建(编译)C 代码的更多信息,请查看 [SO]: LNK2005 Error in CLR Windows Form (@CristiFati's answer)

  • 现在,由于.dll将在导入MySQLClient时由Python加载,因此必须使用相同的编译编译器或更好的编译器:它必须使用与 Python ([Python.Wiki]: WindowsCompilers) 相同的 C 运行时库 (UCRT) )使用(其实这并不是必须的,但是在一个进程中使用多个 UCRT,在 99.99% 的情况下会导致灾难),它尝试使用 Microsoft Visual C++ 来构建它9.0(或VStudio 2008),但找不到它,因此出现错误

您的情况唯一不同的是 Microsoft Visual C++ 10.0 (或 VStudio 2010)版本,这告诉我您正在使用Python 3.3或(很可能)Python 3.4

可能的解决方案:

关于python - 需要 Microsoft Visual C++ 10.0。通过 "Microsoft Windows SDK 7.1": www. microsoft.com/download/details.aspx?id=8279 获取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45782146/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com