I'm trying to run a python script where the first step involves calling in a DLL file from on my computer. When I use Anaconda's Spyder compiler, it works perfectly fine, but when I try to then run the same program from Windows Powershell, I always get this error:
OSError: [WinError 193] %1 is not a valid Win32 application
Here's the section of code that's failing when I run it in Powershell
import ctypes
from ctypes import *
import os
import time
os.chdir("C:\\Tektronix\\RSA_API\\lib\\x64")
rsa = cdll.LoadLibrary("RSA_API.dll")
The error links to the "LoadLibrary" line within my code and then also shows an error in the ctypes file at line 356. But again, it works in Anaconda, so it's apparently not broken enough that it can't run at all. I don't know how to fix this, and I would like to be able to run it in Powershell eventually.