-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Loading DLL, Windows 11, TH260N #33
Comments
Could it be, the restart fixed it? The redistributable wants a restart, if I remeber right! |
Are you using anaconda? |
Unfortunately, a restart did not fix it. I actually tried it with anaconda when first setting up the system and I couldn't initialize a snAPI() object at all (it was giving the same OS Error). Then I went through the install instructions more carefully, and noticed that you recommended a "regular" python install, not with conda. This worked for a while but now the error has resurfaced. |
I fixed it! I used the process monitor for Windows to monitor processes in the Failed and Successful cases, then compared the processes. The problem was related to using PyQt5 in the same script as snAPI. Apparently, PyQt5 looks for the DLL "MSVCP140.dll" in its own directories before checking the system directories, which was interfering with snAPI's ability to load the correct version of this DLL. The solution was to import and initialize the snAPI package and object before importing PyQt5. This ensures that snAPI loads its required DLLs from the correct locations (typically system directories) before PyQt5 has a chance to interfere with the DLL search path. This approach allows snAPI to resolve its dependencies correctly, avoiding conflicts with PyQt5's bundled DLLs. If you're experiencing similar issues with snAPI and PyQt5 (or other large libraries with bundled DLLs), try reorganizing your imports to prioritize snAPI's initialization. |
Describe the bug
Hello. I am experiencing an inconsistent error in loading the "snAPI64.dll" file. This may be due to my own ignorance, but I'm out of troubleshooting ideas.
Screenshot 1 shows the command line output when I run my program. It fails on initialization of a snAPI object (
self.sn = snAPI()
).However, if I restart the kernel and in the command line I initialize a snAPI object (
from snAPI.Main import *; sn = snAPI()
, Screenshot 2), the device connects just fine. If I then close the device and exit the API (sn.closeDevice(); sn.exitAPI()
), I can run my program without issues.This error occurred when I was setting up this system, but as if by magic, it disappeared. This issue has resurfaced with zero changes to the system.
Trouble Shooting I Have Tried
Screenshots
Screenshot 1:
Screenshot 2:
System Specs:
Additional context
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: