gpt4 book ai didi

python - 安装 divisi2 时,Visual C++ for python 失败,退出状态为 2

转载 作者:行者123 更新时间:2023-11-28 21:45:11 24 4
gpt4 key购买 nike

我在 Windows 8.1 46 位上使用 Python 2.7。

我要安装divisi2

我已经安装了 NumPy 和 SciPy,它们已经是 divisi2 的先决条件。我已经为 Python 9.0 安装了 Visual C++。

每当我发出 pip install divisi2 命令时,我都会在控制台中收到以下错误。


svdlib/svdwrapper.c(89) : error C2059: syntax error : '{'
svdlib/svdwrapper.c(90) : error C2275: 'PyObject' : illegal use of this type as an expression c:\python27\include\object.h(108) : see declaration of 'PyObject'
svdlib/svdwrapper.c(90) : error C2065: 'arr' : undeclared identifier
svdlib/svdwrapper.c(90) : error C2065: 'type' : undeclared identifier
svdlib/svdwrapper.c(90) : warning C4047: 'function' : 'PyArray_Descr *' differs in levels of indirection from 'int'
svdlib/svdwrapper.c(90) : warning C4024: 'function through pointer' : different types for formal and actual parameter 2
svdlib/svdwrapper.c(91) : error C2065: 'dim' : undeclared identifier
svdlib/svdwrapper.c(91) : warning C4047: 'function' : 'npy_intp *' differs in levels of indirection from 'int'
svdlib/svdwrapper.c(91) : warning C4024: 'function through pointer' : different types for formal and actual parameter 4
svdlib/svdwrapper.c(91) : error C2065: 'strides' : undeclared identifier
svdlib/svdwrapper.c(91): warning C4047: 'function' : 'npy_intp *' differs in levels of indirection from 'int'
svdlib/svdwrapper.c(91): warning C4024: 'function through pointer': different types for formal and actual parameter 5
svdlib/svdwrapper.c(95) : error C2065: 'arr' : undeclared identifier
svdlib/svdwrapper.c(96): error C2065: 'arr': undeclared identifier
svdlib/svdwrapper.c(96): warning C4047: 'return': 'int *' differs in levels of indirection from 'int'
svdlib/svdwrapper.c(100) : error C2143: syntax error : missing '{' before '*'
svdlib/svdwrapper.c(102) : warning C4133: 'initializing' : incompatible types - from 'int *' to 'PyObject *'
svdlib/svdwrapper.c(114) : warning C4133: 'return' : incompatible types - from 'PyObject *' to 'int *'
error: command 'C:\\Users\\i054564\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\
\users\\i054564\\appdata\\local\\temp\\pip-build-0aufqt\\divisi2\\setup.py';exec
(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'),
__file__, 'exec'))" install --record c:\users\i054564\appdata\local\temp\pip-5dxl7g-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\i054564\appdata\local\temp\pip-build-0aufqt\divisi2\

最佳答案

以上两种方法都很好用。
不过这个要简单一些。
https://go.microsoft.com/fwlink/?LinkId=691126 安装 Visual C++ 2015 构建工具使用默认选择。

关于python - 安装 divisi2 时,Visual C++ for python 失败,退出状态为 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39771592/

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