Embded Python Import Ctypes fails
Question: I'm using Python for .Net using python 2.7, I copied All the needed
directories from the Python2.7 into my Application Directory when I try to
import ctypes, in the interactive shell

    
    
    import ctypes
    

the Error is

    
    
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\TesetPyNet\bin\Debug\lib\ctypes\__init__.py", line 10, in <module>
        from _ctypes import Union, Structure, Array
    ImportError: DLL load failed: The specified module could not be found.
    

what I'm asking is there is any away to set the path to the Dll folder.

Note: when I embeded python 3.4.3 into my c# app and copied the Directories of
python run-time into my app directory, It worked fine with importing ctypes,
even on OS with no already Installed versions of python


Answer: After some digging and inspection, _ctypes.pyd is nothing but an OS specific
(dynamic link library'for windows'-Shared object 'for UNIX like')

So when I inspected its dependencies,unlike python27.dll that depeneds on
msvcr100.dll.It depends on msvcr90.dll

so the solution is Only to copy msvcr90.dll into the working directory of the
application OR the DLLs directory, beside _ctypes.pyd

