ImportError: DLL load failed: %1 is not a valid Win32 application

I upgraded my sdk version from 2.5 to 3.2 using below command in Anaconda Prompt

python -m pip install couchbase==3.2 --upgrade

installation is successful but while doing “import couchbase” I’m getting the below error

ImportError: DLL load failed: %1 is not a valid Win32 application.

I use windows 10

Anyone please help me resolve this issue.

Hi @Kratos - This problem occurs when either a 32-bit Python interpreter is trying to read a 64-bit libcouchbase.dll or a 64-bit Python interpreter is trying to read a 32-bit libcouchbase.dll. So, we have to figure out why the environment is picking up the incorrect libcouchbase.dll. Can you provide feedback on the following?

  • What version of anaconda?
  • The output from the following
python -c "import sys;print(sys.version)"
  • Could you provide what you have in your PATH, PYTHON and PYTHONPATH environment variables (they might not all be set, but curious what would be in any or all 3)?
  • Also, have you previously installed a version of libcouchbase (the Couchbase C-SDK)?