No module named Boto3 error

I’m following this workflow here for automatic invoice processing:

I have installed Anaconda 3, and have ran the Anaconda command prompt to run the command:
python -m pip install boto3

The workflow runs successfully until the Python Script node, where I get the following error:

ERROR Python Script 3:3 Execute failed: No module named ‘boto3’
Traceback (most recent call last):
File “”, line 23, in
ModuleNotFoundError: No module named ‘boto3’

Apologies in advance if I’m missing something simple. From my end, it looks like I’ve installed all the packages I needed.

@wisemanleo my recommendation would be to install miniconda and use a YAML file provided by KNIME and maybe edit it to use only conda-forge and include boto3 or install it later via the prompt. Make sure you have the right environment activated:

conda install -c conda-forge boto3

1 Like

Thanks - I missed the YML part. Passed those issues now, thank you! Now the new issue :slight_smile: :

ERROR Python Script 3:3 Execute failed: ‘Textract’ object has no attribute ‘analyze_expense’
Traceback (most recent call last):
File “”, line 31, in
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\client.py”, line 601, in getattr
self.class.name, item)
AttributeError: ‘Textract’ object has no attribute ‘analyze_expense’

Maybe you have to install that also. Not sure if this is a dependency that should have been installed automatically:

conda install -c conda-forge textract

You might want to check if Python 3.6 is the right version for you you could try and use 3.9 which should be supported by KNIME-. I would list all the packages you need in a YAML file and maybe create a new Environment. Anaconda or Miniconda should make sure that the versions would match. Sometimes there can be differences even between the standard Anaconda and conda-forge repositories. So maybe stick to one. I prefer to use conda-forge since at the moment it also appears to be the ‘free’ version.

1 Like

Amazing. I think I’m almost there - now have this credentials issue, which I thought was already addressed in the first part of the workflow. I’m googling at the moment on how to address the following:

ERROR Python Script 3:3 Execute failed: Unable to locate credentials
Traceback (most recent call last):
File “”, line 35, in
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\client.py”, line 401, in _api_call
return self._make_api_call(operation_name, kwargs)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\client.py”, line 718, in _make_api_call
operation_model, request_dict, request_context)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\client.py”, line 737, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\endpoint.py”, line 107, in make_request
return self._send_request(request_dict, operation_model)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\endpoint.py”, line 180, in _send_request
request = self.create_request(request_dict, operation_model)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\endpoint.py”, line 121, in create_request
operation_name=operation_model.name)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\hooks.py”, line 358, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\hooks.py”, line 229, in emit
return self._emit(event_name, kwargs)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\hooks.py”, line 212, in _emit
response = handler(**kwargs)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\signers.py”, line 95, in handler
return self.sign(operation_name, request)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\signers.py”, line 167, in sign
auth.add_auth(request)
File “C:\ProgramData\Anaconda3\envs\py36_knime\lib\site-packages\botocore\auth.py”, line 401, in add_auth
raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials

Got the Python Script working - I had to install Amazon CLI and input my credentials in Command Prompt.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.