ModuleNotFoundError: No module named 'searchconsole'

Hi guys,

I’m trying to connect KNIME with the Google Search Console. I use this script in Python Script node:

import pandas as pd
import searchconsole
import pickle

file = searchconsole.authenticate(client_config=‘…json’)
account = searchconsole.authenticate(client_config=file)
output_table_1 = pd.DataFrame([p.raw for p in account.webproperties])
output_object_1 = pickle.dumps(account)

But I get an error: ModuleNotFoundError: No module named ‘searchconsole’

If I execute this script in Jupyter Notebook ist works:
import searchconsole
account = searchconsole.authenticate(client_config=‘…json’)

Python integration in KNIME is installed.
What do I wrong?

Hi aschalay,

it looks like searchconsole is not installed in the Python environment you are using in your Python Script node. You could check which Python environment you are using via Preferences → KNIME → Python. On that Python environment , you can install the missing module. Does this help? Don’t hesitate to ask further questions!

Best regards
Steffen

1 Like

Hi Steffen,

thanks for your response. But how do I install the module on the Python enviroment I’m using in KNIME?
I already tried pip install searchconsole.

Hi aschalay,

just that we are on the same page:

  1. You found out on the preference page, which Python environment you use, correct?
  2. You activated the environment on your console via conda activate <your Python environment>?
  3. You installed searchconsole via pip install searchconsole within the activated environment?
  4. You checked that it is installed via conda list and you see it
  5. You restarted KNIME

Did you perform these steps, did all of them work and is the Python Script throwing the same error? Don’t hesitate to ask further questions!

Best regards
Steffen

1 Like

Hi Steffen,

thank you very much for the detailed instruction!
I missed step 2: “You activated the environment on your console via conda activate <your Python environment>?”

Now it works!

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