1
votes

/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lpython2.7 collect2: error: ld returned 1 exit status

I am working on cygwin, trying to install sentry and encountered this error?

Can anyone tell why I am running into this problem, is the problem related to python-dev package ?

Also how to install python-dev on cygwin if required ?

1
Do you have python2.7-dev installed?Ziyad Edher
@Wintro that's the problem, I tried to run pip install python-dev in cygwin but it return the error, Moreover while installing cygwin I tried to add relevant file to install, but I don't have a sure shot way of knowing.Abhishek Choudhery

1 Answers

2
votes

To search a package containing a file you can use cygcheck or https://cygwin.com/packages/

Using cygcheck in your case:

$ cygcheck -p libpython2.7.dll.a
Found 3 matches for libpython2.7.dll.a
python-devel-2.7.12-1 - python-devel: Python language interpreter (installed binaries and support files)
python-2.7.10-1 - python: Python language interpreter (installed binaries and support files)
python2-devel-2.7.13-1 - python2-devel: Python 2 language interpreter

So you need to install with Cygwin Setup the python2-devel package as it is the last version with the right file.
Do not use pip install for packages already available from Cygwin Setup