ludlows / PESQ

PESQ (Perceptual Evaluation of Speech Quality) Wrapper for Python Users (narrow band and wide band)
https://github.com/ludlows/PESQ
MIT License
518 stars 97 forks source link

Pip3 install fails #49

Closed StanislavJochman closed 1 year ago

StanislavJochman commented 1 year ago

Hi when installing using pip3 it fails:

Collecting https://github.com/ludlows/python-pesq/archive/master.zip
  Downloading https://github.com/ludlows/python-pesq/archive/master.zip
     / 223 kB 1.3 MB/s
Building wheels for collected packages: pesq
  Building wheel for pesq (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-5_6n31st/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-5_6n31st/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-vm7tblzc
       cwd: /tmp/pip-req-build-5_6n31st/
  Complete output (34 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.9
  creating build/lib.linux-x86_64-3.9/pesq
  copying pesq/_pesq.py -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/__init__.py -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/cypesq.pyx -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/pesqpar.h -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/pesqmain.h -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/pesqio.h -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/pesq.h -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/dsp.h -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/dsp.c -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/pesqdsp.c -> build/lib.linux-x86_64-3.9/pesq
  copying pesq/pesqmod.c -> build/lib.linux-x86_64-3.9/pesq
  running build_ext
  Compiling pesq/cypesq.pyx because it changed.
  [1/1] Cythonizing pesq/cypesq.pyx
  /tmp/pip-req-build-5_6n31st/.eggs/Cython-3.0.0-py3.9-linux-x86_64.egg/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-req-build-5_6n31st/pesq/cypesq.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  warning: pesq/cypesq.pyx:60:4: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
  warning: pesq/cypesq.pyx:61:4: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
  warning: pesq/cypesq.pyx:62:4: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
  building 'cypesq' extension
  creating build/temp.linux-x86_64-3.9
  creating build/temp.linux-x86_64-3.9/pesq
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-RNBry6/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-RNBry6/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ipesq -I/usr/local/lib/python3.9/dist-packages/numpy/core/include -I/usr/local/lib/python3.9/dist-packages/numpy/core/include -I/usr/include/python3.9 -c pesq/cypesq.c -o build/temp.linux-x86_64-3.9/pesq/cypesq.o
  pesq/cypesq.c:46:10: fatal error: Python.h: No such file or directory
     46 | #include "Python.h"
        |          ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pesq
  Running setup.py clean for pesq
Failed to build pesq
Installing collected packages: pesq
    Running setup.py install for pesq ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-5_6n31st/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-5_6n31st/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-cx0zluxt/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/pesq
         cwd: /tmp/pip-req-build-5_6n31st/
    Complete output (27 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.9
    creating build/lib.linux-x86_64-3.9/pesq
    copying pesq/_pesq.py -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/__init__.py -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/cypesq.pyx -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/pesqpar.h -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/pesqmain.h -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/pesqio.h -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/pesq.h -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/dsp.h -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/dsp.c -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/pesqdsp.c -> build/lib.linux-x86_64-3.9/pesq
    copying pesq/pesqmod.c -> build/lib.linux-x86_64-3.9/pesq
    running build_ext
    building 'cypesq' extension
    creating build/temp.linux-x86_64-3.9
    creating build/temp.linux-x86_64-3.9/pesq
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-RNBry6/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-RNBry6/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ipesq -I/usr/local/lib/python3.9/dist-packages/numpy/core/include -I/usr/local/lib/python3.9/dist-packages/numpy/core/include -I/usr/include/python3.9 -c pesq/cypesq.c -o build/temp.linux-x86_64-3.9/pesq/cypesq.o
    pesq/cypesq.c:46:10: fatal error: Python.h: No such file or directory
       46 | #include "Python.h"
          |          ^~~~~~~~~~
    compilation terminated.
    error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-5_6n31st/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-5_6n31st/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-cx0zluxt/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/pesq Check the logs for full command output.
StanislavJochman commented 1 year ago

Fixed by running pip3 install cython

ludlows commented 1 year ago

thanks for the issue you have raised. it seems that the pip didn't find the "Python.h" . did you try the latest code using pip3 install pesq==0.0.4?

StanislavJochman commented 1 year ago

@ludlows It was already fixed after running

pip3 install cython

Will close this issue