0

I am installing Python psycopg2 , its compilation fails: OS: Windows 8 64 bit Python: 2.7 mingw-w64

C:/mingw-w64/x86_64-4.9.0-win32-seh-rt_v3-rev2/mingw64/bin/../lib/gcc/x86_64-w64
-mingw32/4.9.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lpython27

collect2.exe: error: ld returned 1 exit status
error: command 'C:\\mingw-w64\\x86_64-4.9.0-win32-seh-rt_v3-rev2\\mingw64\\bin\\
gcc.exe' failed with exit status 1
Milen A. Radev
  • 54,001
  • 19
  • 99
  • 105
  • 1
    You might want to install a [binary distribution of psycopg2 for Windows](http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg). – Matthias Jun 26 '14 at 14:10

1 Answers1

2

cannot find -lpython27

python27.lib is not on your LIBRARY_PATH. It's hard to say why or provide more info because you didn't explain how you got to this point - commands run, Python version installed, etc.

In any case, I strongly recommend that you just use the binary installers. See these existing answers:

Community
  • 1
  • 1
Craig Ringer
  • 259,831
  • 56
  • 584
  • 684