@sabsab OK it took a minute longer. Maybe there is a more elegant solution but it should work if there is always the same number of Rows with the identical RowID which I understand is the case. If not the try-catch might have to look different.
@sabsab in the example there is a conda environment propagation that should bring all the necessary packages together in an Anaconda/Miniconda environment. In the annotations of the node there is the code for the YAML file used.
Other that that here are other environments you might try (also some especially for Windows). If you have eg. Miniconda set up in KNIME you should be able just to use the Propagation.
This would then check the exact packages suitable for your environment while resprecting the boundaries set in the file:
name: py37_knime # Name of the created environment
channels: # Repositories to search for packages
dependencies: # List of packages that should be installed
- python>=3.7,<3.8 # Python
- py4j # used for KNIME <-> Python communication
- nomkl # Prevents the use of Intel's MKL
- pandas # Table data structures
- jedi # Python script autocompletion
- python-dateutil # Date and Time utilities
- numpy # N-dimensional arrays
- cairo # SVG support
- pillow # Image inputs/outputs
- pyarrow=6.0 # Arrow serialization
- IPython # Notebook support
- nbformat # Notebook support
- scipy # Notebook support
- jpype1 # Databases
- h5py<3.0 # must be < 3.0 because they changed whether str or byte is returned
- libiconv # MDF Reader node
- asammdf=5.19.14 # MDF Reader node
- openpyxl # Excel Reader
- scikit-learn # Machine Learning
# Additional packages
I know that conda environment management is initially not so easy, but once you get it it is not that complicated and you gain much flexibility with regards to your settings.
OK that would be a step once you have your environment and you have activated the specific one you want to use.
conda activate py37_knime
Well the code was right there in the entry - the file is in a subfolder /data/ of the workflow which is not visible in the KNIME explorer. You would have to check your file. But you managed to download a YAML file from KNIME’s collection.
The main change I did was limit the channel to “conda-forge” which is because of Anaconda changing its license conditions, so in order to stay ‘free’ you might have to limit your usage to this channel (plus some extra things via pip).
Just a small follow up. You are now using the base environment of python which is fine. I just thought you had problems with that and therefore suggested a new environment but now it seems possible the pytrends package was not installed in the first place. That option had not occurred to me - and very possibly was fixed by the conda install …
From my experience if you use python a lot you will have to create and re-install environments, versions and packages all the time …
Yes, the original problem was to filter out keywords that cannot be processed by Google Trends. This could have been solved directly in the Python code (pytrend) or a Knime solution like this one.
So this is a great solution to work through a list of keywords in Google Trends.
The Python environment was previously at least such that I could run pytrend.
Python and all possible customizations are still rather trial and error for me - but I’m working on it