@REM Adapt the directory in the PATH to your system @SET PATH=%LocalAppData%\anaconda3\Scripts;%PATH% @CALL activate knime || ECHO Activating failed @python %*
This is windows 10. same bat with different file paths on different machine works fine. I actually used the full path before using %LocalAppData% but that makes no difference.
Also it takes very long till the error shows and I can paste the commands into cmd, they work. If I run the bat via cmd I get the same error as in knime while it takes a long time (30 sec) for it to show.
I reinstalled anaconda to shorten the file / dir path length (in case that is the issue). I can run the script from the a cmd window and it immediately shows a python prompt form the correct environment.
However in knime right now instead of an error it gets stuck at “Testing Python 3 Installation…”
Has this been tested on win10? For me this now is clearly a knime issue as the env works fine and so does the script.
Glad to hear at least this problem got resolved. Sorry for the wrong pointer.
Yes, this is tested virtually daily. I also checked back with some Windows 10 users here at KNIME and none of them experienced that problem so far.
Would you mind trying to manually execute this installation test outside KNIME and see if it also hangs there? You can do it like that:
Locate the test file in your local KNIME installation. It should be here: <KNIME-installation-directory>\plugins\org.knime.python2_<KNIME-version>\py\PythonKernelTester.py
Open a cmd.
Execute a command of the form: <path-to-Python-start-script> <path-to-test-file> 3.0.0
Example: C:\Users\Marcel\py36_knime.bat "C:\Programs\KNIME 3.7.1\plugins\org.knime.python2_3.7.1.v201901281201\py\PythonKernelTester.py" 3.0.0
The command should return something like “Python version: 3.6.7” if it ran successfully or return a list of errors if e.g., a required package is missing.
Alright. So this is just guesswork, but it might be a permissions issue. Could you try to move the python.cmd file to your user directory and/or launch KNIME as administrator, if possible, and retry?
Also, are “.cmd” files and “.bat” files the same, that is, are they interpreted exactly the same by Windows cmd? Maybe renaming the file to “.bat” might be worth a try.
(Just looking for the parts that are different to the setup we test which is the location of the script and its extension, here).
Note that the cmd prompt I used above was not elevated so theoretically it should also fail.
In the .log file I found this stack trace which seems relevant. this happens at startup before I do any action.
ENTRY org.eclipse.osgi 2 0 2019-02-18 13:40:45.588
!MESSAGE While loading class “org.knime.python.typeextension.PythonModuleExtensions”, thread “Thread[DL-Installation-Test-org.knime.dl.keras.tensorflow.core.DLKerasTensorFlowNetwork,5,main]” timed out waiting (5001ms) for thread “Thread[DL-Installation-Test-org.knime.dl.tensorflow.savedmodel.core.TFSavedModelNetwork,5,main]” to finish starting bundle “org.knime.python.typeextensions_3.5.0.v201811141615 [987]”. To avoid deadlock, thread “Thread[DL-Installation-Test-org.knime.dl.keras.tensorflow.core.DLKerasTensorFlowNetwork,5,main]” is proceeding but “org.knime.python.typeextension.PythonModuleExtensions” may not be fully initialized.
!STACK 0
org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; type=“osgi.bundle”; version:Version=“3.5.0.v201811141615”; osgi.identity=“org.knime.python.typeextensions”; singleton:=“true” [id=987] STARTED [STARTED]
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:337)
at org.eclipse.osgi.container.Module.start(Module.java:401)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:103)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:368)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:442)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.knime.dl.python.core.DLPythonDefaultContext.execute(DLPythonDefaultContext.java:130)
at org.knime.dl.python.core.DLPythonAbstractCommands.testInstallation(DLPythonAbstractCommands.java:263)
at org.knime.dl.python.core.DLPythonAbstractNetworkLoader$DLPythonInstallationTester.lambda$0(DLPythonAbstractNetworkLoader.java:117)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
… 16 more
Root exception:
java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
at org.eclipse.osgi.container.Module.start(Module.java:401)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:103)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:368)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:442)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.knime.dl.python.core.DLPythonDefaultContext.execute(DLPythonDefaultContext.java:130)
at org.knime.dl.python.core.DLPythonAbstractCommands.testInstallation(DLPythonAbstractCommands.java:263)
at org.knime.dl.python.core.DLPythonAbstractNetworkLoader$DLPythonInstallationTester.lambda$0(DLPythonAbstractNetworkLoader.java:117)
at java.lang.Thread.run(Thread.java:748)
!ENTRY org.eclipse.osgi 2 0 2019-02-18 13:40:45.592
!MESSAGE While loading class “org.knime.python.typeextension.PythonModuleExtensions”, thread “Thread[DL-Installation-Test-org.knime.dl.keras.theano.core.DLKerasTheanoNetwork,5,main]” timed out waiting (5001ms) for thread “Thread[DL-Installation-Test-org.knime.dl.tensorflow.savedmodel.core.TFSavedModelNetwork,5,main]” to finish starting bundle “org.knime.python.typeextensions_3.5.0.v201811141615 [987]”. To avoid deadlock, thread “Thread[DL-Installation-Test-org.knime.dl.keras.theano.core.DLKerasTheanoNetwork,5,main]” is proceeding but “org.knime.python.typeextension.PythonModuleExtensions” may not be fully initialized.
!STACK 0
org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; type=“osgi.bundle”; version:Version=“3.5.0.v201811141615”; osgi.identity=“org.knime.python.typeextensions”; singleton:=“true” [id=987] STARTED [STARTED]
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:337)
at org.eclipse.osgi.container.Module.start(Module.java:401)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:103)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:368)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:442)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.knime.dl.python.core.DLPythonDefaultContext.execute(DLPythonDefaultContext.java:130)
at org.knime.dl.python.core.DLPythonAbstractCommands.testInstallation(DLPythonAbstractCommands.java:263)
at org.knime.dl.python.core.DLPythonAbstractNetworkLoader$DLPythonInstallationTester.lambda$0(DLPythonAbstractNetworkLoader.java:117)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
… 16 more
Root exception:
java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
at org.eclipse.osgi.container.Module.start(Module.java:401)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:103)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:368)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:442)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.knime.dl.python.core.DLPythonDefaultContext.execute(DLPythonDefaultContext.java:130)
at org.knime.dl.python.core.DLPythonAbstractCommands.testInstallation(DLPythonAbstractCommands.java:263)
at org.knime.dl.python.core.DLPythonAbstractNetworkLoader$DLPythonInstallationTester.lambda$0(DLPythonAbstractNetworkLoader.java:117)
at java.lang.Thread.run(Thread.java:748)
!ENTRY org.eclipse.osgi 2 0 2019-02-18 13:40:45.596
!MESSAGE While loading class “org.knime.python.typeextension.PythonModuleExtensions”, thread “Thread[DL-Installation-Test-org.knime.dl.keras.cntk.core.DLKerasCNTKNetwork,5,main]” timed out waiting (5001ms) for thread “Thread[DL-Installation-Test-org.knime.dl.tensorflow.savedmodel.core.TFSavedModelNetwork,5,main]” to finish starting bundle “org.knime.python.typeextensions_3.5.0.v201811141615 [987]”. To avoid deadlock, thread “Thread[DL-Installation-Test-org.knime.dl.keras.cntk.core.DLKerasCNTKNetwork,5,main]” is proceeding but “org.knime.python.typeextension.PythonModuleExtensions” may not be fully initialized.
!STACK 0
org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; type=“osgi.bundle”; version:Version=“3.5.0.v201811141615”; osgi.identity=“org.knime.python.typeextensions”; singleton:=“true” [id=987] STARTED [STARTED]
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:337)
at org.eclipse.osgi.container.Module.start(Module.java:401)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:103)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:368)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:442)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.knime.dl.python.core.DLPythonDefaultContext.execute(DLPythonDefaultContext.java:130)
at org.knime.dl.python.core.DLPythonAbstractCommands.testInstallation(DLPythonAbstractCommands.java:263)
at org.knime.dl.python.core.DLPythonAbstractNetworkLoader$DLPythonInstallationTester.lambda$0(DLPythonAbstractNetworkLoader.java:117)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
… 16 more
Root exception:
java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
at org.eclipse.osgi.container.Module.start(Module.java:401)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:103)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:368)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:442)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.knime.dl.python.core.DLPythonDefaultContext.execute(DLPythonDefaultContext.java:130)
at org.knime.dl.python.core.DLPythonAbstractCommands.testInstallation(DLPythonAbstractCommands.java:263)
at org.knime.dl.python.core.DLPythonAbstractNetworkLoader$DLPythonInstallationTester.lambda$0(DLPythonAbstractNetworkLoader.java:117)
at java.lang.Thread.run(Thread.java:748)
I’m gonna reinstall knime. I think the installation is completely borked. I uninstalled the python integration but it’s still there, all the folders and option in knime. It’s not actually removed at all…
So either uninstall is broken or my knime install.