我正在尝试在Python 2.7中安装MySQLdb。我遇到的错误看起来像是这样:
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/include/mysql -I/opt/python2.7/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
gcc -pthread -shared build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib64/mysql -L. -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -lmygcc -lpython2.7 -o build/lib.linux-x86_64-2.7/_mysql.so
/usr/bin/ld: cannot find -lpython2.7
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
很明显,它找不到Python 2.7。在/usr/bin
中查看,我看到:
python*
python2@
python2.4*
python2.7@
在编程中,@
符号代表着不同的含义,具体取决于使用的编程语言和上下文。在某些情况下,它可能表示一个注释或者调用函数时的参数。如果你遇到了错误,请提供更多的信息和代码内容以便其他人能够帮助你找到解决方案。
python-dev
包(与 @ 无关)。 - JBernardo