/usr/bin/ld: cannot find -lpython2.7

前端 未结 2 1746
青春惊慌失措
青春惊慌失措 2020-12-14 10:38

I\'m trying to install MySQLdb with Python 2.7. The error I\'m getting looks like this:

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wal         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 11:05

    The above solution didn't quite do it for me as I was using pip to install mysql-python, but was definitely a big push in the right direction. For the benefit of anyone who lands here from Google in the same situation as me, my solution was to symlink libpython2.7.a from the python installation directory to the lib dir:

    ln -s /opt/python2.7.1/lib/python2.7/config/libpython2.7.a

    /usr/local/lib/

    pip install mysql-python worked without any issues afterwards.

提交回复
热议问题