Linking errors when compiling python extension module

点点圈 提交于 2019-11-29 15:48:48
akgood

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.

I had the same error. Installing psycopg2 from https://github.com/nwcell/psycopg2-windows solved my problem

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.

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"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!