Forums › General Discussions › Python 2.7 ctypes sa_api.dll Windows 10 1803 1903
- This topic has 2 replies, 2 voices, and was last updated 5 years, 5 months ago by
HalHoffman.
- AuthorPosts
HalHoffmanParticipantHas anyone seen this behavior?
I have a Python program using ctypes to load sa_api.dll. It works on an older computer with Windows 10 1803 and fails on a newer computer with Windows 10 1903. Both with Python 2.7.7 and 2.7.17.
Files in the directory –
ex1.py
sa_api.dllThe source code –
# ex1.py
import ctypes
from ctypes import wintypes
sa_dll = ctypes.CDLL(“sa_api.dll”)
print “Open sa_api.dll success”Running the program on the newer computer with Windows 10 1903 –
>python ex1.py
Traceback (most recent call last):
File “ex1.py”, line 4, in <module>
sa_dll = ctypes.CDLL(“sa_api.dll”)
File “C:\Python27\lib\ctypes\__init__.py”, line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be foundOn a different computer running Windows 1803 this code runs correctly.
It is curious that ctypes cannot find the file sa_api.dll which is in the same directory as the program.
I believe the two computer are setup the same way regarding this. Their python paths (sys.path) are the same.
I suspect that this version of Windows has broken something.
Has anyone seen this behavior and have ideas of a workaround?
Thanks
AndrewModeratorDo you have the ftd2xx.dll file in the same directory as well?
HalHoffmanParticipantYes, the ftd2xx.dll file is in the same directory. I had moved the dll files from “Program Files (x86)/Signal Hound/Spike” to this test directory to make an example with the fewest files possible.
I had done another test where the example program opened ftd2xx.dll instead of sa_api.dll, and that was successful.
sa_dll = ctypes.CDLL(“ftd2xx.dll”), so ctypes found that file. I don’t know if that is a useful clue.Another observation is that with this same computer, running Window 1903, my software failed to open a DataQ data logging module, while it was successful with several other computers running Windows 1803. It generated a different error. It is curious that access to two different devices would fail with the new computer.
Thanks
- AuthorPosts
You must be logged in to reply to this topic.