So I\'m writing a python extension module in C and I\'m trying to compile it for my 64-bit Python build. After bashing my head against MinGW for a while, I did some googling
1、you must make sure that python x64、oracle client x64(win7 x64),all the versions must match.
2、perhaps you have to "install vc++ for python2.7"
I had the same error. Installing psycopg2 from https://github.com/nwcell/psycopg2-windows solved my problem
In my experience, it's very difficult to build python modules on windows with anything from Microsoft except the full version of Visual C++. Further, the version of Visual Studio must match the version that was used to build your python distribution.
For example, with the official binary dist of Python 2.7.1:
C:\Python27>python
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32
...
According to What version of Visual Studio is Python on my computer compiled with?, that means that python was built with Visual C++ 2008.
For each version of Visual Studio, there is a corresponding version of the Windows SDK, so if you want to try to make this work with free tools, you need to find and install the correct Windows SDK version. I think that might be http://www.microsoft.com/en-us/download/details.aspx?id=24826, but I'm not 100% sure.
For my case , changing project properties in Visual studio (building solution for x64 instead of x86) helped , as Python version I was using was 64 bit . Both the versions shall match.