pip install functools raises error:ERROR: Could not build wheels for functools, which is required to install pyproject.toml-based projects

303 views Asked by At

functools is a library that comes with Python 3.9, but it needs to be installed in Python 3.7. The existing code is from 3.7.12. Now it runs without functools, but when installing with pip it reports:

Collecting functools
  Using cached functools-0.5.tar.gz (4.9 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: functools
  Building wheel for functools (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [57 lines of output]
      src/compose.c:96:6: error: no member named 'ob_type' in 'struct compose'
              co->ob_type->tp_free(co);
***********A long list of error descriptions in the middle******************
 12 warnings and 3 errors generated.
      error: command '/usr/bin/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 functools
  Running setup.py clean for functools
Failed to build functools
ERROR: Could not build wheels for functools, which is required to install pyproject.toml-based projects

I get this error in both Linux and MACOS.

Can anyone please help me out of this problem?

I tried in MacOS and then in Linux, but get the same error. And searched the whole network but still can't get a clue. I feel like the environment is missing something.

1

There are 1 answers

0
y2k23 martin On

The functools is a library that already comes with Python 3.7. But the function I need isn't. I will close this.