spin6lock / python-sproto

python binding to sproto

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

windows安装pysproto报错

3638836363 opened this issue · comments

Microsoft Windows 11 专业版
python 3.11.1
`PS C:\Users\Administrator> pip3 install pysproto
Collecting pysproto
Downloading pysproto-0.1.4.tar.gz (19 kB)
Preparing metadata (setup.py) ... done
Installing collected packages: pysproto
DEPRECATION: pysproto is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for pysproto ... error
error: subprocess-exited-with-error

× Running setup.py install for pysproto did not run successfully.
│ exit code: 1
╰─> [37 lines of output]
running install
D:\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\pysproto_rpc
copying src\pysproto_rpc\sproto.py -> build\lib.win-amd64-cpython-311\pysproto_rpc
copying src\pysproto_rpc_init_.py -> build\lib.win-amd64-cpython-311\pysproto_rpc
running build_ext
building 'pysproto' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
creating build\temp.win-amd64-cpython-311\Release\src
creating build\temp.win-amd64-cpython-311\Release\src\pysproto
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -ID:\Python\Python311\include -ID:\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" /Tcsrc/pysproto/python_sproto.c /Fobuild\temp.win-amd64-cpython-311\Release\src/pysproto/python_sproto.obj
python_sproto.c
src/pysproto/python_sproto.c(1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
src/pysproto/python_sproto.c(91): warning C4244: “=”: 从“double”转换到“__int64”,可能丢失数据
src/pysproto/python_sproto.c(149): warning C4244: “return”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(76): warning C4244: “初始化”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(266): warning C4244: “函数”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(279): warning C4244: “函数”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(379): warning C4244: “函数”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(400): warning C4244: “函数”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(398): warning C4244: “初始化”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(418): warning C4244: “函数”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(418): warning C4244: “函数”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(434): warning C4244: “函数”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(434): warning C4244: “函数”: 从“Py_ssize_t”转换到“int”,可能丢失数据
src/pysproto/python_sproto.c(524): error C2449: 在文件范围内找到“{”(是否缺少函数头?)
src/pysproto/python_sproto.c(524): error C2059: 语法错误:“}”
src/pysproto/python_sproto.c(524): error C2059: 语法错误:“)”
src/pysproto/python_sproto.c(539): error C2065: “module”: 未声明的标识符
src/pysproto/python_sproto.c(539): warning C4133: “函数”: 从“int *”到“PyModuleDef *”的类型不兼容
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pysproto

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.`

win10下碰到同样问题,尝试重新安装Microsoft Visual Studio组件,暂时无法解决;Linux和MacOS下使用没问题.

python_sproto.c line:527 移除这个注释 //py3 ? 可以解决windows安装问题

@3638836363 我删掉这个注释了,pypi包已更新,非常感谢!