'ERROR: Could not build wheels for couchbase which use PEP 517 and cannot be installed directly

I am following the couchbase documentation and tried to install the python SDK and I am getting the above error.

sudo -H python3 -m pip install couchbase

I am using pipenv for my virtual environment.

Some error log

  ERROR: Failed building wheel for couchbase
Failed to build couchbase
ERROR: Could not build wheels for couchbase, which is required to install pyproject.toml-based projects
Exception information:
Traceback (most recent call last):
  File "/Users/kapilraj/.local/share/virtualenvs/customer-backend-XMYO8NLG/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 164, in exc_logging_wrapper
    status = run_func(*args)
  File "/Users/kapilraj/.local/share/virtualenvs/customer-backend-XMYO8NLG/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 204, in wrapper
    return func(self, options, args)
  File "/Users/kapilraj/.local/share/virtualenvs/customer-backend-XMYO8NLG/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 374, in run
    raise InstallationError(
pip._internal.exceptions.InstallationError: Could not build wheels for couchbase, which is required to install pyproject.toml-based projects





Solution 1:[1]

That was the issue. I had libcouchbase@2 installed via Brew since more recent versions of that library would not work with earlier versions of the SDK. Once I removed the old libcouchbase and installed the new one, I was able to build the wheel. Thanks!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Madhu Cheepati