首页 > 解决方案 > 在 Windows 10 上安装 Python 包时出错

问题描述

我用几个不同的包(RPi.GPIO,GPIO)尝试了 pip 和 easy_install,每个包在运行时都返回相同的错误:

C:\Python37\Scripts>easy_install RPIO
Searching for RPIO
Reading https://pypi.org/simple/RPIO/
Downloading https://files.pythonhosted.org/packages/29/05/6884572923c57ff488fdf5c4ab887deb9edb2515afbcb49be087c95ac698/RPIO-0.10.0.tar.gz#sha256=b89f75dec9de354681209ebfaedfe22b7c178aacd91a604a7bd6d92024e4cf7e
Best match: RPIO 0.10.0
Processing RPIO-0.10.0.tar.gz
Writing C:\Users\arnjm\AppData\Local\Temp\easy_install-ytbbi35y\RPIO-0.10.0\setup.cfg
Running RPIO-0.10.0\setup.py -q bdist_egg --dist-dir C:\Users\arnjm\AppData\Local\Temp\easy_install-ytbbi35y\RPIO-0.10.0\egg-dist-tmp-fbmuup99
py_gpio.c
source/c_gpio/py_gpio.c(362): error C2040: 'setmode': 'PyObject *(PyObject *,PyObject *)' differs in levels of indirection from 'int (int,int)'
source/c_gpio/py_gpio.c(431): warning C4028: formal parameter 1 different from declaration
source/c_gpio/py_gpio.c(431): warning C4028: formal parameter 2 different from declaration
source/c_gpio/py_gpio.c(431): warning C4047: 'initializing': 'PyCFunction' differs in levels of indirection from 'int (__cdecl *)(int,int)'
error: Setup script exited with error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

希望有人已经解决了这个问题。

标签: pythoncompiler-errorseasy-install

解决方案


推荐阅读