2401_82357774 2024-01-05 17:52 采纳率: 0%
浏览 267

pip安装pyworld出错

pip安装pyworld出错


Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pyworld
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/1f/a0/94bef26b6e270cf8a0c795c906fcb6dddf6095b48f390b4729185d7c1eeb/pyworld-0.3.4.tar.gz (251 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /home/zhenxia/py38/lib/python3.8/site-packages (from pyworld) (1.24.1)
Collecting cython>=0.24 (from pyworld)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a3/97/dcf27a5708e8e121788d9e5c32df04763cf5063dd5e4320f21543dbdeed8/Cython-3.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)
Building wheels for collected packages: pyworld
  Building wheel for pyworld (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pyworld (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-38
      creating build/lib.linux-x86_64-cpython-38/pyworld
      copying pyworld/__init__.py -> build/lib.linux-x86_64-cpython-38/pyworld
      running build_ext
      Compiling pyworld/pyworld.pyx because it changed.
      [1/1] Cythonizing pyworld/pyworld.pyx
      building 'pyworld.pyworld' extension
      creating build/temp.linux-x86_64-cpython-38
      creating build/temp.linux-x86_64-cpython-38/lib
      creating build/temp.linux-x86_64-cpython-38/lib/World
      creating build/temp.linux-x86_64-cpython-38/lib/World/src
      creating build/temp.linux-x86_64-cpython-38/pyworld
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/cheaptrick.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/cheaptrick.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/codec.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/codec.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/common.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/common.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/d4c.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/d4c.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/dio.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/dio.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/fft.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/fft.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/harvest.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/harvest.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/matlabfunctions.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/matlabfunctions.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/stonemask.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/stonemask.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/synthesis.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/synthesis.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c lib/World/src/synthesisrealtime.cpp -o build/temp.linux-x86_64-cpython-38/lib/World/src/synthesisrealtime.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ilib/World/src -I/tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/numpy/core/include -I/home/zhenxia/py38/include -I/usr/include/python3.8 -c pyworld/pyworld.cpp -o build/temp.linux-x86_64-cpython-38/pyworld/pyworld.o
      pyworld/pyworld.cpp:58:10: fatal error: Python.h: 没有那个文件或目录
         58 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      /tmp/pip-build-env-8ud84w2p/overlay/lib/python3.8/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-install-rjtb6ztk/pyworld_636608d882234efeb8c3ab6848e24163/pyworld/pyworld.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
      error: command '/usr/bin/x86_64-linux-gnu-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 pyworld
Failed to build pyworld
ERROR: Could not build wheels for pyworld, which is required to install pyproject.toml-based projects
  • 写回答

2条回答 默认 最新

  • 虫鸣@蝶舞 2024-01-05 18:03
    关注

    错误提示缺少Python.h,因为你没有安装linux上的python开发包,导致cpython编译源文件失败,按照下面的gpt教程安装下试试看:
    您在安装 pyworld 时遇到了构建错误。这种错误通常发生在缺少某些必需组件(如头文件或库)的情况下。在您的具体案例中,错误信息 fatal error: Python.h: 没有那个文件或目录 表明您的环境中缺少 Python 开发头文件。

    为了解决这个问题,您需要安装 Python 开发包,它包含了构建 Python 模块所需的头文件和静态库。具体的包名称可能会根据您的操作系统及其版本而有所不同。

    如果您使用的是基于 Debian 的系统(如 Ubuntu),可以使用以下命令安装 Python 开发包:

    sudo apt-get install python3-dev

    这个命令会为 Python 3 安装开发头文件和库,应该能解决 Python.h 文件缺失的问题。安装 python3-dev 后,再次尝试安装 pyworld。

    记得使用与您所用 Python 版本相对应的命令(例如,对于 Python 3.8,使用 python3.8-dev)。

    评论

报告相同问题?

问题事件

  • 创建了问题 1月5日