gpt4 book ai didi

python - 安装基于 pyproject.toml 的项目所需的错误 : Could not build wheels for pymssql,

转载 作者:行者123 更新时间:2023-12-05 05:51:18 25 4
gpt4 key购买 nike

我在安装 pymsql 时遇到问题,你们中有人遇到过类似情况吗?

我发现了与我的 M1 用户类似的问题 Link

我也试过:

升级pip:python -m pip install --upgrade pip

升级轮子:pip install --upgrade wheel

升级设置工具:pip install --upgrade setuptools

当我尝试安装时,我收到了:

Collecting pymssql
Using cached pymssql-2.2.2.tar.gz (170 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: startedNote: you may need to restart the kernel to use updated packages.
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: pymssql
Building wheel for pymssql (pyproject.toml): started

ERROR: Command errored out with exit status 1:
command: 'C:\Users\mikol\AppData\Local\Programs\Python\Python310\python.exe' 'C:\Users\mikol\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\mikol\AppData\Local\Temp\tmpli4438o6'
cwd: C:\Users\mikol\AppData\Local\Temp\pip-install-f4z0veo1\pymssql_f17e29cc25734af0a975be16add0d1d8
Complete output (23 lines):
setup.py: platform.system() => Windows
setup.py: platform.architecture() => ('64bit', 'WindowsPE')
setup.py: include_dirs => []
setup.py: library_dirs => []
running bdist_wheel
running build Building wheel for pymssql (pyproject.toml): finished with status 'error'
Failed to build pymssql

running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\pymssql
copying src\pymssql\__init__.py -> build\lib.win-amd64-3.10\pymssql
running build_ext
cythoning src\pymssql\_mssql.pyx to src\pymssql\_mssql.c
cythoning src\pymssql\_pymssql.pyx to src\pymssql\_pymssql.c
building 'pymssql._mssql' extension
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
creating build\temp.win-amd64-3.10\Release\src
creating build\temp.win-amd64-3.10\Release\src\pymssql
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\mikol\AppData\Local\Programs\Python\Python310\include -IC:\Users\mikol\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /Tcsrc\pymssql\_mssql.c /Fobuild\temp.win-amd64-3.10\Release\src\pymssql\_mssql.obj -DMSDBLIB
_mssql.c
src\pymssql\_mssql.c(682): fatal error C1083: Nie moľna otworzy† pliku do\x88Ącz: 'sqlfront.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for pymssql
ERROR: Could not build wheels for pymssql, which is required to install pyproject.toml-based projects

任何关于如何修复它的建议将不胜感激。

最佳答案

我不认为我要说的是答案,但我确实想参与其中,以帮助将来可能遇到此问题的其他人。 (我打算把它写成评论,但我只有 3 个代表点)

我的机器不是 M1(它是运行 Windows 10 的英特尔 CPU),我认为我的许多环境与 OP 不同,但我确实设法得到了与 OP 得到的大部分相似的错误。

我最初也通过执行“pip --no-cache-dir install pymssql”来绕过它。效果很好。格拉茨到@Steven-MSFT

但在那之后我偶然发现了更多错误(不是 pymssql),这让我意识到我正在使用构建的 requirement.txt 文件在一个全新的 Python 3.11.1 操作系统上执行“pip install -r requirement.txt”通过使用 Python 3.10.4 的机器

我没有意识到它会带来如此大的不同。显然是这样。无论如何,基本上我想说的是模块尝试为 pymssql 构建轮子的原因可能是您尝试安装的特定版本 pymssql 可能不适合您的 Python 环境。

我怀疑的原因是因为在我卸载 3.11.1 并安装 3.10.4 之后(这是我首先应该做的)'pip install -r requirement.txt' 非常有效。

所以,无论如何,这是我的两分钱的值(value)。

仅供引用:我在安装时遇到问题的 pymssql 版本是 2.2.5

关于python - 安装基于 pyproject.toml 的项目所需的错误 : Could not build wheels for pymssql,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70403724/

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