vBaiCai / python-pesq

A python package for calculating the PESQ.
MIT License
353 stars 69 forks source link

Difficulty installing #30

Closed austinpharper closed 3 months ago

austinpharper commented 3 months ago

I am trying to install pesq on a PC running Windows 11. Running "pip install pesq" I get the error:

Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.

So then I try "pip install --use-pep517 pesq" and I get this:

Collecting pesq
  Using cached pesq-0.0.4.tar.gz (38 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pesq
  Building wheel for pesq (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pesq (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-39
      creating build\lib.win-amd64-cpython-39\pesq
      copying pesq\_pesq.py -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\__init__.py -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\cypesq.pyx -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\dsp.h -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\pesq.h -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\pesqio.h -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\pesqmain.h -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\pesqpar.h -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\dsp.c -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\pesqdsp.c -> build\lib.win-amd64-cpython-39\pesq
      copying pesq\pesqmod.c -> build\lib.win-amd64-cpython-39\pesq
      running build_ext
      C:\Users\Austin\AppData\Local\Temp\pip-build-env-whdgjz6a\normal\Lib\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: C:\Users\Austin\AppData\Local\Temp\pip-install-iq5n64re\pesq_8874ba0989db4092a1645ce59a04cf75\pesq\cypesq.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
      Compiling pesq/cypesq.pyx because it changed.
      [1/1] Cythonizing pesq/cypesq.pyx
      building 'cypesq' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pesq
Failed to build pesq
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pesq)

Note: I already have Visual Studio 2022 with Build Tools installed.

austinpharper commented 3 months ago

I solved the problem myself; it was 100% user error. I am leaving this up in case anyone else in the future has the same problems as I did. I turns out that I had Visual Studio installed, but didn't add the correct Build Tools. C++ is not activated by default and you need to select that option during installation.