0

We use a python script to run a camera as part of an experiment. In practice, the python script uses ctypes to load a dll and this is what is used to access the camera functionality. We recently upgraded to a Windows 10 computer, and I now no longer seem to be able to load the dll.

A stripped down version of the relevant script as follows:

PARENT_DIR = os.path.dirname(os.path.realpath(__file__))
os.add_dll_directory(PARENT_DIR)
x = ct_util.find_library('picam_64bit')
self.picam = ct.WinDLL(x)

On the fourth line, the following error is returned:

[WinError 127] The specified procedure could not be found

A few further notes:

  • The camera works with the manufacturer-supplied executable.
  • The code was originally written in Python 2.7 and has been migrated to Python 3.8. The same error occurs in both.
  • This question is clearly relevant. I have made sure that only one version of Python is installed at a time (right now, 3.8), and there is only one version of the dll on the computer.
  • The third line returns a sensible value, so Python can clearly `see' the DLL, just not load it.
RPM
  • 1,704
  • 12
  • 15
  • Could be some dependency dll is missing. Use dependency walker to find the dependent dlls and make sure they are available in the same path. – abhilb Feb 02 '21 at 16:07
  • `cd` to the directory where the DLL is, run Python, and directly load the DLL with `import ctypes;dll = ctypes.WinDLL('./picam_64bit')`. Same error? – Mark Tolonen Feb 02 '21 at 16:22
  • @adhilb ; Sorry for the delay, I have limited lab access at the moment. I have run the dependency walker and it flags up a number of missing dlls, but these are all api-ms-win and ext-ms-win dlls that are apparently not a problem https://stackoverflow.com/questions/36240215/dependency-walker-missing-dlls – RPM Feb 04 '21 at 17:42
  • @MarkTolonen, Yes, same error when I do that. – RPM Feb 04 '21 at 17:55
  • @adhilb ; I stand corrected. In addition to the api-ms-win dlls and ext-ms win dlls that are apparently not cause for concern, there are five missing dlls: GCBASE_MD_VC100_V2_4.DLL, GENAPI_MD_VC100_V2_4.DLL, HVSIFILETRUST.DLL, IESHIMS.DLL, LOG4CXX.DLL. Are these any cause for concern? Does the VC100 stand for some kind of visual C package? – RPM Feb 04 '21 at 18:00

0 Answers0