首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >rtmidi-python的PIP失败构建轮(子进程-退出错误和遗留安装失败)

rtmidi-python的PIP失败构建轮(子进程-退出错误和遗留安装失败)
EN

Stack Overflow用户
提问于 2022-03-09 14:16:50
回答 1查看 4.2K关注 0票数 2

rtmidi-python的PIP失败构建轮(子进程-退出错误和遗留安装失败)

大家好,我在运行Raspbian 11的Raspberry Pi 4B上安装rtmidi-python时,遇到了pip的问题。

建筑车轮一直失败的软件包,我得到了两个错误:子进程退出-与-错误和遗留安装失败。

下面是命令pip install rtmidi-python的输出:

代码语言:javascript
运行
复制
pi@raspberrypi:~ $ pip install rtmidi-python
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting rtmidi-python
  Using cached rtmidi-python-0.2.2.tar.gz (54 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: rtmidi-python
  Building wheel for rtmidi-python (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [164 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'rtmidi_python' extension
      creating build
      creating build/temp.linux-armv7l-3.9
      creating build/temp.linux-armv7l-3.9/RtMidi
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -D__LINUX_ALSA__ -I/usr/include/python3.9 -c RtMidi/RtMidi.cpp -o build/temp.linux-armv7l-3.9/RtMidi/RtMidi.o
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -D__LINUX_ALSA__ -I/usr/include/python3.9 -c rtmidi_python.cpp -o build/temp.linux-armv7l-3.9/rtmidi_python.o
      rtmidi_python.cpp: In function ‘PyObject* PyInit_rtmidi_python()’:
      rtmidi_python.cpp:2932:39: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
       2932 |   __pyx_type_13rtmidi_python_MidiBase.tp_print = 0;
            |                                       ^~~~~~~~
      rtmidi_python.cpp:2941:38: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
       2941 |   __pyx_type_13rtmidi_python_MidiOut.tp_print = 0;
            |                                      ^~~~~~~~
      [...]
      rtmidi_python.cpp:3110:59: note: in expansion of macro ‘PyUnicode_GET_SIZE’
       3110 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                                                           ^~~~~~~~~~~~~~~~~~
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for rtmidi-python
  Running setup.py clean for rtmidi-python
Failed to build rtmidi-python
Installing collected packages: rtmidi-python
  Running setup.py install for rtmidi-python ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for rtmidi-python did not run successfully.
  │ exit code: 1
  ╰─> [166 lines of output]
      running install
      /home/pi/.local/lib/python3.9/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_ext
      building 'rtmidi_python' extension
      creating build
      creating build/temp.linux-armv7l-3.9
      creating build/temp.linux-armv7l-3.9/RtMidi
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -D__LINUX_ALSA__ -I/usr/include/python3.9 -c RtMidi/RtMidi.cpp -o build/temp.linux-armv7l-3.9/RtMidi/RtMidi.o
      arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -D__LINUX_ALSA__ -I/usr/include/python3.9 -c rtmidi_python.cpp -o build/temp.linux-armv7l-3.9/rtmidi_python.o
      rtmidi_python.cpp: In function ‘PyObject* PyInit_rtmidi_python()’:
      rtmidi_python.cpp:2932:39: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
       2932 |   __pyx_type_13rtmidi_python_MidiBase.tp_print = 0;
            |                                       ^~~~~~~~
      rtmidi_python.cpp:2941:38: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
       2941 |   __pyx_type_13rtmidi_python_MidiOut.tp_print = 0;
            |                                      ^~~~~~~~
      [...]
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
      [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.
╰─> rtmidi-python

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

Pip (22.0.4)和Python (3.9.2)是最新的。

我尝试从PyPI (https://pypi.org/project/rtmidi-python/#files)手动下载包,以便用python setup.py install安装它,但它似乎没有安装任何东西:下面是输出:

代码语言:javascript
运行
复制
pi@raspberrypi:~/Downloads/rtmidi-python-0.2.2 $ sudo python setup.py install
running install
running build
running build_ext
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/rtmidi_python-0.2.2.egg-info
Writing /usr/local/lib/python2.7/dist-packages/rtmidi_python-0.2.2.egg-info

对一些人来说,这可能是setup.py的一个问题,但我不知道更多。我一直在寻找解决方案在无数的论坛上,但没有成功。你的帮助将不胜感激。

谢谢你们所有人。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-03-09 18:31:08

tp_print方法已从Python3.8中的API中删除。错误"'PyTypeObject‘{aka 'struct _typeobject'}没有名为’tp_print‘的成员“,这意味着代码用于Pythons3.8。降级到Python3.8,然后重试。

让我们看看rtmidi-pythonhttps://pypi.org/project/rtmidi-python/#history。目前唯一发布的版本是0.2.2。该版本于2014年2月5日发布。它看起来太老了,我不确定它是否能与Python 3一起工作。试试Python3.8和Python2.7。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71410788

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档