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

Hi,

I am trying to install sdk 3 of couchbase on my Windows machine but I am facing issue while running “python -m pip install couchbase” command. The error is related to the build of the wheel for couchbase, I am using windows 10, python 3.7.4 , I’ve tried verious version discussed in similar topic but none seems to work for me, this is my error log, can someone please help me?

Hi @Nicola_Marchiotto I am pretty sure you would have tried everything,

I see first error in the attached log as ModuleNotFoundError: No module named ‘docutils’

did you try installing docutils ? Also tagging @davidkelly

Hi @Nicola_Marchiotto -
We distribute the wheel already built for windows, so I’d think this couldn’t happen. But, we only distribute them for 64-bit python. The error logs look like you are running a 32-bit (x86) python. Do you really need 32-bit python?

If you really need 32-bit, I can check to see if it is possible. We use libcouchbase under the hood in the Python SDK, and I’m not at all sure we can compile in 32-bits.

Thanks for the support, I’ve installed python 3.9 64-bit and docutils module but the error still occurs, during the installation the command window still says that docutils is missing even if I can see that it is installed by the pip list command, here’s my new error log

@Nicola_Marchiotto - sorry I should have mentioned that we also don’t distribute a binary for python 3.9. Try 3.8 or 3.7 instead, they works fine for me. We will probably build for python 3.9 soon – now that there is a stable version. But, unsure exactly when that will come out.

2 Likes

@davidkelly I’m getting same issue on Mac.
Version :Python 3.8.7 for macOS 10.9 or later for the following architecture(s): x86_64.
Can you pls suggest

@sv Did you fix it yet? My colleague got the same issue but I didn’t and we created the same virtual environment. Finally I fixed it for my colleague by downgrading python from 3.8.2 to 3.7.0 and the couchbase could be installed. Although it’s fixed but I don’t know why. Please let me know if you find any other solutions.

same here.
ERROR: Failed building wheel for couchbase
Failed to build couchbase
ERROR: Could not build wheels for couchbase which use PEP 517 and cannot be installed directly

On python 3.9
Tried downgrade to 3.8 3.8.5
tried different CB sdk 3.0.0
3.0.1 and latest one .

I tried everything google can answer …
Nothing,lost,…

Hi @BgOKcomp – what OS are you using? Also, have you tried v 3.1.3 of the SDK? The README has been updated recently to try and provide further guidance on installation. Can you check that out?

If that still doesn’t help, can you provide the output of your pip install w/ added verbosity? python3 -m pip install -v -v -v couchbase==3.1.3

I’m encountering the same issue on Mac OS 10.15.7 using various Couchbase versions and various Python versions. Here is the output from my most recent attempt using Python 3.7.7. The form field isn’t large enough for the whole log, so here’s the last bit.

 ➜ python3 -m pip install -v -v -v couchbase==3.1.3
...
[ 90%] Built target libcouchbase_src
  /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/couchbase_python_client.dir/build.make CMakeFiles/couchbase_python_client.dir/depend
  cd /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/temp.macosx-10.14-x86_64-3.7 && /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-build-env-o7_bdmbd/overlay/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0 /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0 /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/temp.macosx-10.14-x86_64-3.7 /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/temp.macosx-10.14-x86_64-3.7 /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/temp.macosx-10.14-x86_64-3.7/CMakeFiles/couchbase_python_client.dir/DependInfo.cmake --color=
  /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/couchbase_python_client.dir/build.make CMakeFiles/couchbase_python_client.dir/build
  [100%] Linking C shared library ../lib.macosx-10.14-x86_64-3.7/couchbase_core/_dummy.so
  /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-build-env-o7_bdmbd/overlay/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/couchbase_python_client.dir/link.txt --verbose=1
  /Library/Developer/CommandLineTools/usr/bin/cc -Wno-strict-prototypes -fPIC -std=c11 -Wsometimes-uninitialized -Wconditional-uninitialized -Wno-nullability-completeness -Wno-expansion-to-defined -Wuninitialized -Wswitch -Werror -Wno-missing-braces -DPYCBC_LCB_API=0x02FF04  -fPIC -fno-strict-aliasing -Wno-missing-braces -Wstrict-prototypes -fno-common -dynamic -DNDEBUG -g -fwrapv -Wswitch -DPYCBC_LCB_API=0x02FF04 -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.15 -dynamiclib -Wl,-headerpad_max_install_names -L/usr/local/opt/libcouchbase@2/lib -o ../lib.macosx-10.14-x86_64-3.7/couchbase_core/_dummy.so -install_name @rpath/_dummy.so  install/lib/Release/libcouchbase.dylib -Wl,-rpath,/private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/temp.macosx-10.14-x86_64-3.7/install/lib/Release
  [100%] Built target couchbase_python_client
  /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-build-env-o7_bdmbd/overlay/lib/python3.7/site-packages/cmake/data/CMake.app/Contents/bin/cmake -E cmake_progress_start /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/temp.macosx-10.14-x86_64-3.7/CMakeFiles 0
  From: temp_build_dir build/temp.macosx-10.14-x86_64-3.7 and ssl_relative_path None Got ssl_abs_path /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/temp.macosx-10.14-x86_64-3.7/openssl
  set base as ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  got rpaths ['@loader_path', 'build/temp.macosx-10.14-x86_64-3.7/install/lib/Release']
  set base as ['build', 'temp.macosx-10.14-x86_64-3.7']
  LIBDIR /Users/jlcross/.pyenv/versions/3.7.7/lib, LIBPL /Users/jlcross/.pyenv/versions/3.7.7/lib/python3.7/config-3.7m-darwin
  got fpath /Users/jlcross/.pyenv/versions/3.7.7/lib/libpython3.7m.a:
  fpath /Users/jlcross/.pyenv/versions/3.7.7/lib/libpython3.7m.a is file, selecting
  got fpath /Users/jlcross/.pyenv/versions/3.7.7/lib/python3.7/config-3.7m-darwin/libpython3.7m.a:
  fpath /Users/jlcross/.pyenv/versions/3.7.7/lib/python3.7/config-3.7m-darwin/libpython3.7m.a is file, selecting
  fpath /Users/jlcross/.pyenv/versions/3.7.7/lib/libpython3.7.dylib does not exist
  got fpath /Users/jlcross/.pyenv/versions/3.7.7/include/python3.7m/../../lib:
  fpath /Users/jlcross/.pyenv/versions/3.7.7/include/python3.7m/../../lib is directory, contents ['pkgconfig', 'python3.7', 'libpython3.7m.a']
  trying subentry:/Users/jlcross/.pyenv/versions/3.7.7/lib/pkgconfig
  got match /Users/jlcross/.pyenv/versions/3.7.7/lib/pkgconfig, breaking out
  trying subentry:/Users/jlcross/.pyenv/versions/3.7.7/lib/python3.7
  got match /Users/jlcross/.pyenv/versions/3.7.7/lib/python3.7, breaking out
  trying subentry:/Users/jlcross/.pyenv/versions/3.7.7/lib/libpython3.7m.a
  got match /Users/jlcross/.pyenv/versions/3.7.7/lib/libpython3.7m.a, breaking out
  Launching build with env: {'LDFLAGS': '-L/usr/local/opt/libcouchbase@2/lib', 'rvm_use_flag': '', 'VIRTUALENVWRAPPER_SCRIPT': '/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh', 'VIRTUALENVWRAPPER_PROJECT_FILENAME': '.project', 'rvm_bin_path': '/Users/jlcross/.rvm/bin', 'NEWRELIC_LICENSE_KEY': '*****', 'TERM_PROGRAM': 'Apple_Terminal', 'SAUCE_USERNAME': 'audienceplatform', 'PHANTOMJS_BIN': '/usr/local/bin/phantomjs', 'PYENV_ROOT': '/Users/jlcross/.pyenv', 'rvm_quiet_flag': '', 'NVM_CD_FLAGS': '-q', 'rvm_gemstone_url': '', 'TERM': 'xterm-256color', 'SHELL': '/bin/zsh', 'rvm_docs_type': '', 'CPPFLAGS': '-I/usr/local/opt/libcouchbase@2/include', 'TMPDIR': '/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/', 'FASTLY_SERVICE_ID': '2ZQ1rQN8fEMNLQYoCZQd5q', 'GOOGLE_APPLICATION_CREDENTIALS': '/Users/jlcross/Sites/gup/key-file.json', 'PYTHONHTTPSVERIFY': '0', 'VAULT_ADDR': 'https://vault.gannettdigital.com/', 'TERM_PROGRAM_VERSION': '433', 'PAAS_API_KEY': '*****', 'rvm_hook': '', 'TERM_SESSION_ID': 'B14F7A5E-2298-48BE-8DD2-F9CA99BE8E44', 'PYENV_VERSION': 'aplcb3', 'SCALR_API_SECRET': '*****', 'ZSH': '/Users/jlcross/.oh-my-zsh', 'SCALR_API_KEY': '*****', 'NVM_DIR': '/Users/jlcross/.nvm', 'USER': 'jlcross', 'rvm_gemstone_package_file': '', '_system_type': 'Darwin', 'SITE_CODE': 'USAT', 'rvm_path': '/Users/jlcross/.rvm', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.9k1OBE1b9E/Listeners', 'PYENV_DIR': '/Users/jlcross/Sites/gup/audience-persistence-lib', 'PYENV_VIRTUALENV_VERBOSE_ACTIVAT': 'true', 'rvm_proxy': '', 'PYENV_VIRTUALENV_INIT': '1', 'VIRTUAL_ENV': '/Users/jlcross/.pyenv/versions/3.7.7/envs/aplcb3', 'rvm_ruby_file': '', 'PAGER': 'less', 'PYENV_VIRTUAL_ENV': '/Users/jlcross/.pyenv/versions/3.7.7/envs/aplcb3', 'WORKON_HOME': '/Users/jlcross/.virtualenvs', 'LSCOLORS': 'Gxfxcxdxbxegedabagacad', 'rvm_silent_flag': '', 'rvm_prefix': '/Users/jlcross', 'VIRTUALENVWRAPPER_PYTHON': '/usr/bin/python', 'rvm_ruby_make': '', 'PATH': '/private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-build-env-o7_bdmbd/overlay/bin:/private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-build-env-o7_bdmbd/normal/bin:/Users/jlcross/.pyenv/versions/aplcb3/bin:/usr/local/Cellar/pyenv/2.0.4/libexec:/usr/local/Cellar/pyenv/2.0.4/plugins/python-build/bin:/usr/local/opt/libcouchbase@2/bin:/usr/local/opt/openssl@1.1/bin:/usr/local/opt/openssl/bin:/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/jlcross/.pyenv/shims:/usr/local/opt/protobuf@2.6/bin:/Users/jlcross/.nvm/versions/node/v0.12.15/bin:/Users/jlcross/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/jlcross/.pyenv/shims:/usr/local/opt/openssl/bin:/Users/jlcross/.npm-packages/bin:./node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/Users/jlcross/google-cloud-sdk/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/jlcross/Sites/go/bin:/usr/local/go/bin:/Users/jlcross/.rvm/bin:/Users/jlcross/.rvm/bin', 'VIRTUALENVWRAPPER_HOOK_DIR': '/Users/jlcross/.virtualenvs', 'UW_NEWRELIC': 'true', 'APPROLE_NAME': 'gup-scalr', 'ACL_NO_USE_CACHE': 'false', 'PWD': '/Users/jlcross/Sites/gup/audience-persistence-lib', 'COUCHBASE_NAME_REMOTE': 'gup-dev-east-v6_6', 'SLACK_NO_AUTO_UPDATES': '1', 'rvm_sdk': '', 'LANG': 'en_US.UTF-8', 'PYENV_HOOK_PATH': '/Users/jlcross/.pyenv/pyenv.d:/usr/local/Cellar/pyenv/2.0.4/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks', '_OLD_VIRTUAL_PS1': '${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)', '_system_arch': 'x86_64', 'CONSUL_ACL_TOKEN': '*****', 'XPC_FLAGS': '0x0', '_system_version': '10.15', 'RECAPTCHA_PUBLIC_KEY': '*****', 'CORAL_TALK_JWT_SECRET': '*****', 'COUCHBASE_NAME_LOCAL': 'gup-dev-east-v6_6', 'RBENV_SHELL': 'zsh', 'FASTLY_API_KEY': '*****', 'FIREFLY_EXTERNAL_SECRET': '*****', 'ENVIRONMENT': 'development', 'XPC_SERVICE_NAME': '0', 'rvm_version': '1.29.3 (latest)', 'REGION': 'us-east-1', 'rvm_script_name': '', 'rvm_pretty_print_flag': '', 'PYENV_SHELL': 'zsh', 'HOME': '/Users/jlcross', 'SHLVL': '1', 'rvm_ruby_mode': '', 'GOROOT': '/usr/local/go', 'SCALR_CLOUD_LOCATION': 'us-east-1', 'VAULT_TOKEN': '*****', 'COUCHBASE_CONFIG_FILE': '/Users/jlcross/Sites/gup/audience-persistence-lib/my_config.json', 'LESS': '-R', 'LOGNAME': 'jlcross', 'rvm_alias_expanded': '', 'LC_CTYPE': 'en_US.UTF-8', 'rvm_wrapper_name': '', 'UW_LOCAL_CLIENT_ROOT': '/Users/jlcross/Sites/go/src/github.com/GannettDigital/universal-web-client', 'SAUCE_ACCESS_KEY': '*****', 'NVM_BIN': '/Users/jlcross/.nvm/versions/node/v0.12.15/bin', 'PKG_CONFIG_PATH': '/usr/local/opt/libcouchbase@2/lib/pkgconfig', 'UW_LOCAL_TEMPLATES_ROOT': '/Users/jlcross/Sites/go/src/github.com/GannettDigital/universal-web-themes', 'NEWRELIC_APP_NAME': 'Universal-Web-Server-Local', 'GOPATH': '/Users/jlcross/Sites/go', 'rvm_nightly_flag': '', 'VIRTUALENVWRAPPER_WORKON_CD': '1', 'CB_MASTER': '2459-7358-scalr.development.gannettdigital.com', 'rvm_ruby_make_install': '', 'APP_ENV': 'prod', 'rvm_niceness': '', 'rvm_ruby_bits': '', 'RECAPTCHA_PRIVATE_KEY': '*****', 'rvm_bin_flag': '', 'PYENV_ACTIVATE_SHELL': '1', 'rvm_only_path_flag': '', 'APL_LOG_LEVEL': 'WARNING', 'PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV': 'true', '_system_name': 'OSX', 'VAULT_PATH': 'secret/gup/kubernetes/clusterops-clusters/', '__CF_USER_TEXT_ENCODING': '0x49B17680:0x0:0x0', 'PIP_REQ_TRACKER': '/private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-req-tracker-eou9bz50', 'PYTHONNOUSERSITE': '1', 'PYTHONPATH': '/private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-build-env-o7_bdmbd/site', 'PEP517_BUILD_BACKEND': 'setuptools.build_meta:__legacy__', 'PLAT': 'macosx-10.14-x86_64', 'CXXFLAGS': ' -Wno-strict-prototypes -fPIC -Wsometimes-uninitialized -Wconditional-uninitialized -Wno-nullability-completeness -Wno-expansion-to-defined -Wuninitialized -Wswitch -Werror -Wno-missing-braces -DPYCBC_LCB_API=0x02FF04 -DVERSION_INFO=\\"3.1.3\\"', 'CFLAGS': ' -Wno-strict-prototypes -fPIC -std=c11 -Wsometimes-uninitialized -Wconditional-uninitialized -Wno-nullability-completeness -Wno-expansion-to-defined -Wuninitialized -Wswitch -Werror -Wno-missing-braces -DPYCBC_LCB_API=0x02FF04'}, build_args: ['--config', 'Release', '--', '-j2'], cmake_args: ['-DPYCBC_LCB_API=0x02FF04', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/lib.macosx-10.14-x86_64-3.7/couchbase_core', '-DPYTHON_EXECUTABLE=/Users/jlcross/.pyenv/versions/aplcb3/bin/python3', '-DPYTHON_INCLUDE_DIR=/Users/jlcross/.pyenv/versions/3.7.7/include/python3.7m', '-DHYBRID_BUILD=TRUE', '-DPYTHON_LIBFILE=/Users/jlcross/.pyenv/versions/3.7.7/lib/libpython3.7m.a', '-DPYTHON_LIBDIR=/Users/jlcross/.pyenv/versions/3.7.7/lib', '-DPYTHON_VERSION_EXACT=3.7', '-DCMAKE_BUILD_TYPE=RELEASE', '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON', '-DPYTHON_EXECUTABLE=/Users/jlcross/.pyenv/versions/aplcb3/bin/python3']
  Got platform darwin
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  copying build/temp.macosx-10.14-x86_64-3.7/install/lib/Release/libcouchbase.2.dylib to /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/lib.macosx-10.14-x86_64-3.7/couchbase_core/libcouchbase.2.dylib
  success
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  copying build/temp.macosx-10.14-x86_64-3.7/install/lib/Release/libcouchbase.2.dylib to /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/couchbase_core/libcouchbase.2.dylib
  success
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  copying build/temp.macosx-10.14-x86_64-3.7/install/lib/Release/libcouchbase.dylib to /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/build/lib.macosx-10.14-x86_64-3.7/couchbase_core/libcouchbase.dylib
  success
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  copying build/temp.macosx-10.14-x86_64-3.7/install/lib/Release/libcouchbase.dylib to /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/couchbase_core/libcouchbase.dylib
  success
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  self.base is ['build', 'temp.macosx-10.14-x86_64-3.7']
  building 'couchbase_core._libcouchbase' extension
  creating build/temp.macosx-10.14-x86_64-3.7/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/usr/local/opt/libcouchbase@2/include -Ibuild/temp.macosx-10.14-x86_64-3.7/install/include -I/Users/jlcross/.pyenv/versions/aplcb3/include -I/Users/jlcross/.pyenv/versions/3.7.7/include/python3.7m -Ibuild/temp.macosx-10.14-x86_64-3.7/install/include -I/usr/local/include -c src/bucket.c -o build/temp.macosx-10.14-x86_64-3.7/src/bucket.o -Wno-strict-prototypes -fPIC -std=c11 -Wsometimes-uninitialized -Wconditional-uninitialized -Wno-nullability-completeness -Wno-expansion-to-defined -Wuninitialized -Wswitch -Werror -Wno-missing-braces -DPYCBC_LCB_API=0x02FF04 -DPYCBC_LCB_API=0x02FF04
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:71:9: error: 'LCB_CMD_BASE' macro redefined [-Werror,-Wmacro-redefined]
  #define LCB_CMD_BASE                                                                                                   \
          ^
  /usr/local/opt/libcouchbase@2/include/libcouchbase/couchbase.h:504:9: note: previous definition is here
  #define LCB_CMD_BASE \
          ^
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:121:3: error: typedef redefinition with different types ('struct lcb_CMDCBFLUSH' vs 'lcb_CMDBASE' (aka 'struct lcb_CMDBASE'))
  } lcb_CMDCBFLUSH;
    ^
  /usr/local/opt/libcouchbase@2/include/libcouchbase/couchbase.h:2374:21: note: previous definition is here
  typedef lcb_CMDBASE lcb_CMDCBFLUSH;
                      ^
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:124:5: error: unknown type name 'lcb_STATUS'
      lcb_STATUS rc;
      ^
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:127:3: error: typedef redefinition with different types ('struct (anonymous struct at build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:123:9)' vs 'lcb_RESPBASE')
  } lcb_RESPCBFLUSH;
    ^
  /usr/local/opt/libcouchbase@2/include/libcouchbase/couchbase.h:2375:22: note: previous definition is here
  typedef lcb_RESPBASE lcb_RESPCBFLUSH;
                       ^
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:152:1: error: unknown type name 'lcb_STATUS'
  lcb_STATUS lcb_cbflush3(lcb_INSTANCE *instance, void *cookie, const lcb_CMDCBFLUSH *cmd);
  ^
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:152:25: error: unknown type name 'lcb_INSTANCE'
  lcb_STATUS lcb_cbflush3(lcb_INSTANCE *instance, void *cookie, const lcb_CMDCBFLUSH *cmd);
                          ^
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:232:6: error: redefinition of 'lcb_timeunit_t'
  enum lcb_timeunit_t {
       ^
  /usr/local/opt/libcouchbase@2/include/libcouchbase/couchbase.h:3789:6: note: previous definition is here
  enum lcb_timeunit_t {
       ^
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:233:5: error: redefinition of enumerator 'LCB_TIMEUNIT_NSEC'
      LCB_TIMEUNIT_NSEC = 0, /**< @brief Time is in nanoseconds */
      ^
  /usr/local/opt/libcouchbase@2/include/libcouchbase/couchbase.h:3790:5: note: previous definition is here
      LCB_TIMEUNIT_NSEC = 0, /**< @brief Time is in nanoseconds */
      ^
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:234:5: error: redefinition of enumerator 'LCB_TIMEUNIT_USEC'
      LCB_TIMEUNIT_USEC = 1, /**< @brief Time is in microseconds */
      ^
  /usr/local/opt/libcouchbase@2/include/libcouchbase/couchbase.h:3791:5: note: previous definition is here
      LCB_TIMEUNIT_USEC = 1, /**< @brief Time is in microseconds */
      ^
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:235:5: error: redefinition of enumerator 'LCB_TIMEUNIT_MSEC'
      LCB_TIMEUNIT_MSEC = 2, /**< @brief Time is in milliseconds */
      ^
  /usr/local/opt/libcouchbase@2/include/libcouchbase/couchbase.h:3792:5: note: previous definition is here
      LCB_TIMEUNIT_MSEC = 2, /**< @brief Time is in milliseconds */
      ^
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:236:5: error: redefinition of enumerator 'LCB_TIMEUNIT_SEC'
      LCB_TIMEUNIT_SEC = 3   /**< @brief Time is in seconds */
      ^
  /usr/local/opt/libcouchbase@2/include/libcouchbase/couchbase.h:3793:5: note: previous definition is here
      LCB_TIMEUNIT_SEC = 3 /**< @brief Time is in seconds */
      ^
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:253:1: error: unknown type name 'lcb_STATUS'
  lcb_STATUS lcb_enable_timings(lcb_INSTANCE *instance);
  ^
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:253:31: error: unknown type name 'lcb_INSTANCE'
  lcb_STATUS lcb_enable_timings(lcb_INSTANCE *instance);
                                ^
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:264:1: error: unknown type name 'lcb_STATUS'
  lcb_STATUS lcb_disable_timings(lcb_INSTANCE *instance);
  ^
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:264:32: error: unknown type name 'lcb_INSTANCE'
  lcb_STATUS lcb_disable_timings(lcb_INSTANCE *instance);
                                 ^
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:281:38: error: unknown type name 'lcb_INSTANCE'
  typedef void (*lcb_timings_callback)(lcb_INSTANCE *instance, const void *cookie, lcb_timeunit_t timeunit, lcb_U32 min,
                                       ^
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:281:16: error: typedef redefinition with different types ('void (*)(int *, const void *, lcb_timeunit_t, lcb_U32, lcb_U32, lcb_U32, lcb_U32)' (aka 'void (*)(int *, const void *, enum lcb_timeunit_t, unsigned int, unsigned int, unsigned int, unsigned int)') vs 'void (*)(lcb_t, const void *, lcb_timeunit_t, lcb_U32, lcb_U32, lcb_U32, lcb_U32)' (aka 'void (*)(struct lcb_st *, const void *, enum lcb_timeunit_t, unsigned int, unsigned int, unsigned int, unsigned int)'))
  typedef void (*lcb_timings_callback)(lcb_INSTANCE *instance, const void *cookie, lcb_timeunit_t timeunit, lcb_U32 min,
                 ^
  /usr/local/opt/libcouchbase@2/include/libcouchbase/couchbase.h:3839:16: note: previous definition is here
  typedef void (*lcb_timings_callback)(lcb_t instance,
                 ^
  In file included from src/bucket.c:18:
  In file included from src/pycbc.h:67:
  In file included from src/lcb_v4_wrapper.h:20:
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:294:1: error: unknown type name 'lcb_STATUS'
  lcb_STATUS lcb_get_timings(lcb_INSTANCE *instance, const void *cookie, lcb_timings_callback callback);
  ^
  build/temp.macosx-10.14-x86_64-3.7/install/include/libcouchbase/utils.h:294:28: error: unknown type name 'lcb_INSTANCE'
  lcb_STATUS lcb_get_timings(lcb_INSTANCE *instance, const void *cookie, lcb_timings_callback callback);
                             ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  /private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-install-rat0c_n9/couchbase_08960ed0e8ad4233bdab6da37efafaf0/cbuild_config.py:292: UserWarning: Adding /usr/local to lib search path for OS X
    warnings.warn('Adding /usr/local to lib search path for OS X')
  error: command 'clang' failed with exit status 1
  Building wheel for couchbase (PEP 517) ... error
  ERROR: Failed building wheel for couchbase
Failed to build couchbase
ERROR: Could not build wheels for couchbase which use PEP 517 and cannot be installed directly
Exception information:
Traceback (most recent call last):
  File "/Users/jlcross/.pyenv/versions/aplcb3/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 180, in _main
    status = self.run(options, args)
  File "/Users/jlcross/.pyenv/versions/aplcb3/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "/Users/jlcross/.pyenv/versions/aplcb3/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 363, in run
    ", ".join(pep517_build_failure_names)
pip._internal.exceptions.InstallationError: Could not build wheels for couchbase which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 21.1.3; however, version 21.2.4 is available.
You should consider upgrading via the '/Users/jlcross/.pyenv/versions/aplcb3/bin/python3 -m pip install --upgrade pip' command.
Removed build tracker: '/private/var/folders/96/rqd073d53hg1fcrs603h57w14v2xm0/T/pip-req-tracker-eou9bz50'
 ➜ 

Hi @jlcross - From what I can see in the build output, it looks like there are some legacy artifacts lying around. Specifically, ‘LDFLAGS’: ‘-L/usr/local/opt/libcouchbase@2/lib’ and ‘PKG_CONFIG_PATH’: ‘/usr/local/opt/libcouchbase@2/lib/pkgconfig’ ENV variables. You can remove those ENV variables as the 3.x Python SDK will build lcb in place. A way to confirm this is happening is to look for a line in the build output (have to use -v -v -v) that says something similar to Building libcouchbase 3.x.x/<hash id> with the version and hash matching the version of lcb a particular version of the Python SDK uses.

I hope this helps.

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!