12-25-2018 08:29 AM - edited 12-25-2018 08:39 AM
I am using Python steps. That works fine execpt when I have a Python file which imports pylink (https://pylink.readthedocs.io/en/latest/)
It compaints it can not load a DLL:
"DLL load failed: A dynamic link library (DLL) initialization routine failed."
Inside pylink it seems to go wrong on:
from .enums import *
', ' File "C:\WinPython\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\pylink\enums.py", line 15, in
import ctypes
', ' File "C:\WinPython\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\Lib\ctypes\__init__.py", line 10, in
from _ctypes import Union, Structure, Array
', 'ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
'][Error Code: -17500]
If I try to edit the step I get the error "Microsoft Visual C++ Runtime Library, Runtime error!, R6034 An application has made an attempt to load a C runtime library incorrectly"
Please note:
Any idea how to solve?
Solved! Go to Solution.
12-26-2018 03:50 AM - edited 12-26-2018 03:50 AM
Additional info:
I get the same error if I have a Hello World program which just does:
import ctypes
without further using it:
# HelloWorld.py
import ctypes
def hw():
return "Hello World!"
if __name__ == "__main__":
print hw()
12-27-2018 01:39 AM
I Am getting desperate for a solution. I tried everything to my best knowledge with PYTHONPATH, PATH and serach directories in TestStand. Nothing works.
This issue with ctypes in Python Steps makes it uselss if not solvable.
Will try the more difficult way calling the script as 'Call Executable' with stdin and stdout.
Hopefully at least that works.
12-27-2018 04:21 AM
Also Call Executable not working fro my purpose, as I can not keep the Python script open to get input to it after it generated some output on the first input.
It ends with EOL error and closes the script.
Any ideas?
12-27-2018 04:32 AM
I tried your hello world program (which imports ctypes) and it worked fine.
The following was my setup:
- TestStand 2017 64 bit
- Python 2.7 64 bit (downloaded and installed from https://www.python.org/)
- Enabled the option to update PATH environment variable when installing python 2.7
Are you using python interpreter from python.org? If not, can you try it again by installing python from https://www.python.org/?
-Shashidhar
12-27-2018 04:46 AM
Hi Shashidhar,
I am using 64 bit winpython and set the PATH variable to contain:
C:\WinPython\WinPython-64bit-2.7.10.3\python-2.7.10.amd64
C:\WinPython\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\Lib\site-packages\pywin32_system32
C:\WinPython\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\Lib\site-packages\pythonwin
C:\WinPython\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\Lib\site-packages
C:\WinPython\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\libs
I do not want to mess up with winpython, as I use it a lot for other stuff as well by intsalling something next to it.
Will see wether I can do it safely. Perhaps reinstall winpython first then.
12-27-2018 06:06 AM - edited 12-27-2018 06:08 AM
Great Shashidhar !!!
Installing from Python.org solved the problem, No ctypes issue anymore!
Not in Hello World program, but also not with pylink for the Segger J-Link.
re-installing winpython did not help.
It looks like winpython still runs ok for other stuff. But I certainly keep Python form python.org for TestStand.