Could not load file or assembly

I have a failure to initialize with the following error. Any suggestions?

Process Process-1:
Traceback (most recent call last):
File “C:\Users\labadmin\AppData\Local\Programs\Python\Python39\lib\multiprocessing\process.py”, line 315, in _bootstrap
self.run()
File “C:\Users\labadmin\AppData\Local\Programs\Python\Python39\lib\multiprocessing\process.py”, line 108, in run
self._target(*self._args, **self._kwargs)
File “C:\Users\labadmin\AppData\Local\Programs\Python\Python39\lib\site-packages\pyhamilton\interface.py”, line 205, in run_hamilton_process
clr.AddReference(os.path.join(OEM_STAR_PATH, ‘RunHSLExecutor’))
System.BadImageFormatException: Could not load file or assembly ‘file:///C:\Users\labadmin\AppData\Local\Programs\Python\Python39\lib\site-packages\pyhamilton\star-oem\RunHSLExecutor.dll’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: ‘file:///C:\Users\labadmin\AppData\Local\Programs\Python\Python39\lib\site-packages\pyhamilton\star-oem\RunHSLExecutor.dll’
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Python.Runtime.AssemblyManager.LoadAssemblyPath(String name)
at Python.Runtime.CLRModule.AddReference(String name)

Make sure to use 32-bit Python

That got it. I now am simulating your intro script, which is to say that when I run it in python it opens up the deck and when I hit go in run control it pipettes. Is it expected behavior that I should have to start the method in run control rather than it taking off automatically when the python script is run?

1 Like

In simulation mode (which is more accurately run control mode) yes, the script has to be started manually. If you run with simulation mode off then the script automatically starts.