I have a problem with the development environment.
As soon as I create the environment everything works perfectly.
I started by creating a node, it works, great!
Then I created another one, so I structured the folder differently, changing the file names and putting them in folders. Nothing works anymore.
I started over, recreated the environment, immediately created the files with the correct names, created the folders, configured knime.yml, config.yml and the environment, perfect everything works! Eureka
Then I created another node, so I restructured the folders again. Again nothing works anymore.
I repeated the whole procedure again, structuring everything assuming a large number of nodes. However, some new nodes use external classes with different algorithms, so I necessarily had to restructure the folders. Again nothing works anymore.
I cleared the knime cache, the pycharm cache, nothing.
Why is it that if I rename a file nothing works anymore?
Moreover, I use both a desktop computer and a laptop. If I upload everything to GitHub and then download the files to the laptop, I can’t just replace the files, I have to open the file and paste the content of the uploaded file, otherwise nothing works anymore
Can anyone help me with this?
Doing it all over again is really nerve-wracking.
Can you share more details / Screenshots of the errors you are getting?
I followed a similar approach and for me things worked out OK.
I got a fair bit of inspiration on how to structure things with a python based extension after exploring this github repo, which is the python code behind the Geospatial extension:
I pretty much adopted the structure so I have a nodes folder where there is one .py file for every node that holds the entire logic and in the root I just import the nodes:
finnovationflows.py is the file that is equivalent to my_extension.py in the tutorial - the difference being that in the tutorial this holds all your node logic, where I have moved that to the files in the nodes folder.
Here’s then what one of the node files looks like:
Unfortunately, I need to rename the folder because of the shadowing of the name. I followed the structure of geospatial and they call the main folder knime_extension.
Now I need to create some classes (you can see it from the project tree) and import them.
I can’t because the main folder is recognised as the original python package, which is now called knime.extension and if I try to import a class, the system answers that the class is not present inside the knime_extension package, which is instead knime.extension.
Because of this shadowing, if I try to rename the main folder, in order to import everything correctly (classes and utils), when I open Knime, it does not recognise the created nodes.
@MartinDDDD it is in the knime_extension folder, next to the src folder from what I can see.
@AD1529 You sent in your last post two times the same screenshot, it is unclear to me what exactly you changed. And I mean, sure, if you rename any folder containing the knime.yml, then you need to adjust the path in config.yml. If you rename any folder containing the config.yml, you need to adjust the path in the knime.ini of the KNIME Analytics Platform you are developing with. If you rename a folder containing findhr_extension.py, you need to adjust the path in the knime.yml. Could you elaborate which of these cases happened and whether you adjusted the corresponding paths in the aforementioned files?
Hi Steffen,
thanks for taking time to help me.
Unfortunately things are not so easy. What you say is what I did many times, but it does not work.
The problem is the renaming and the replacing. I can’t rename anything and I can’t import any file.
If I rename a file, and I rename everywhere needed (as you stated and as I everytime try to do), nothing works. You might not believe me, but I have been creating knime nodes since March and I repeated I do not know how many times the steps from the beginning since renaming is not possible. So the solution is to take everytime the basic.zip, follow the guide from the beginning, pay attention to the correct names I would like to use, and then add the files .py that I’ll use. Since at the beginning I should have created only a couple of nodes, then they became nine, I did not know at the beginning which structure I would have used. That’s why I needed to rename and create new folders.
Additionally, since I travel a lot and I both use my desktop and my laptop, if I download a file from github, with the same name, from the same project, the same folder, and I replace it in the folder of the computer, nothing works. I have to download it, copy the content, and replace the content of the available file already stored in my computer.
You might not believe me, but this is the procedure I have to do everytime to make everything work.