Linking errors when compiling python extension module

后端 未结 4 2017
遇见更好的自我
遇见更好的自我 2020-12-21 09:00

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

相关标签:
4条回答
  • 2020-12-21 09:43

    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"

    0 讨论(0)
  • 2020-12-21 09:52

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

    0 讨论(0)
  • 2020-12-21 09:58

    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.

    0 讨论(0)
  • 2020-12-21 10:02

    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.

    0 讨论(0)
提交回复
热议问题