[SOLVED] pip fails to install -r requirements.txt

Question

This Content is from Stack Overflow. Question asked by Ahmed ElGazzar

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psutil
Running setup.py clean for psutil
Building wheel for psycopg2 (setup.py) … error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
C:UsersWork pcodoovenvlibsite-packagessetuptoolsconfigsetupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-cpython-310
creating buildlib.win-amd64-cpython-310psycopg2
copying libcompat.py -> buildlib.win-amd64-cpython-310psycopg2
copying liberrorcodes.py -> buildlib.win-amd64-cpython-310psycopg2
copying liberrors.py -> buildlib.win-amd64-cpython-310psycopg2
copying libextensions.py -> buildlib.win-amd64-cpython-310psycopg2
copying libextras.py -> buildlib.win-amd64-cpython-310psycopg2
copying libpool.py -> buildlib.win-amd64-cpython-310psycopg2
copying libsql.py -> buildlib.win-amd64-cpython-310psycopg2
copying libtz.py -> buildlib.win-amd64-cpython-310psycopg2
copying lib_ipaddress.py -> buildlib.win-amd64-cpython-310psycopg2
copying lib_json.py -> buildlib.win-amd64-cpython-310psycopg2
copying lib_lru_cache.py -> buildlib.win-amd64-cpython-310psycopg2
copying lib_range.py -> buildlib.win-amd64-cpython-310psycopg2
copying lib_init_.py -> buildlib.win-amd64-cpython-310psycopg2
running build_ext
building ‘psycopg2._psycopg’ 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 psycopg2
Running setup.py clean for psycopg2
Building wheel for reportlab (setup.py) … error
error: subprocess-exited-with-error

Solution

pip install seg-metrics doesn’t use requirements.txt. Why would it? You have to declare dependencies in setup.py; you can read requirements.txt in setup.py

Answered by phd, Content is distributed under the terms of CC BY-SA 4.0.

people found this article helpful. What about you?