We have recently created a custom Python Node extension, and are running into some problems trying to deploy it to Apple Macs.
The deployment bundle has being successfully deployed on 3 different Windows machines, but it has failed on both the MacBook laptops we have tried.
We get a similar error on both Macs: Could not connect to the Python process
We are assuming that this indicates a problem with the bundled Conda environment, but please let us know if that is not the case.
Do you know the cause of/solution to this problem?
Can you also let us know where the deployed Conda instance is installed on a Mac, so we can test the deployment environment directly.
For reference, here are some details of the two Mac computers where the installation failed, and the errors printout from knime.log:
MacBook Pro used to successfully develop the Python Node Extension and create the deployment bundle
macOS Monterey Version 12.6
MBP 15-inch 2016
Intel Core i7
KNIME V4.6.1
KNIME Python Extension Development (Labs) V4.6.2.v202209150850
MacBook Air - never used for development, with a new installation of KNIME 4.6.2
macOS BigSur V 11.6
MacBook Air M1 2020
Errors:
2022-09-26 17:13:42,869 : ERROR : ForkJoinPool.commonPool-worker-1 : : PurePythonNodeSetFactory : : : java.net.ConnectException: Could not connect to the Python process.
2022-09-26 17:13:42,869 : ERROR : ForkJoinPool.commonPool-worker-1 : : PurePythonNodeSetFactory : : : Failed to parse Python node extension at path â/Applications/KNIME 4.5.0.app/Contents/Eclipse/plugins/com.bctpartners.tree_ruleset_extension_1.0.0.202209190121/src/main/pythonâ.
Sadly the error message doesnât contain enough information. There should be more information about why the extension couldnât be parsed in the âDEBUGâ log (Enable here: File->Preferences->KNIME->Log File Log Level. Open here: View->Open KNIME Log).
It can be a bit hard to find the important details in the cluttered DEBUG log. In the latest nightly we added more information to the ERROR log if the parsing of an extension failed. It would be valuable feedback if you could try the nightly build and report if this information helped.
The bundled environment should be located in the env folder in a plugin called <extension_name>.channel.bin.macos.x86_64_<version>. The plugins are located in the folder <KNIME.app>/Contents/Eclipse/plugins/.
For the machine which produced the error message this folder should be:
DEBUG mode was turned on for the log. This didnât really provide any more insight into the problem. The reason the Python Extension canât be parsed is because KNIME canât connect to the Python process. But why it canât connect to the Python process is still unclear.
The nightly build was installed, but again this didnât identify any additional information for this particular problem.
Finally, the bundled Python environment was tested, but this seemed to work fine.
We still need some help in debugging the problem here.
Maybe listing more details describing its attempts to connect to the Python process in the debug log?
Here are some more technical details of what was tried.
For testing the Python environment we were able to execute automated tests included in the Extension from the bundled Python environment:
Patrick@Cs-MacBook-Air bin % pwd
/Applications/KNIME 4.7.0_2022-09-30_14-04-19.app/Contents/Eclipse/plugins/com.bctpartners.tree_ruleset_extension.channel.bin.macosx.x86_64_1.0.0.202209190121/env/bin
Patrick@Cs-MacBook-Air bin % ./python -m pytest â/Applications/KNIME 4.7.0_2022-09-30_14-04-19.app/Contents/Eclipse/plugins/com.bctpartners.tree_ruleset_extension_1.0.0.202209190121/src/main/python/get_rules_from_pmml_test.pyâ
======= test session starts =======
platform darwin â Python 3.9.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /Applications/KNIME 4.7.0_2022-09-30_14-04-19.app/Contents/Eclipse/plugins
plugins: cov-3.0.0
collected 6 items
Any feedback on this?
Our extension deploys correctly to PCs but not on Macs.
As described above we have tried all the KNIME teamâs suggestions: testing the bundled Python environment, turning on Debug logging, and using the nightly build.
The only message is âCould not connect to the Python processâ which is not enough to debug this problem.
We can provide the entire log file, if that would be helpful. (It wasnât immediately apparent how to attach a file to a forum post.)
We can also provide the extension itself, if that will help identify where the KNIME Python Development Labs extensionâs error handling or debugging needs to be extended to provide sufficient useful information to allow developers to debug Mac installation issues with their custom extensions.