gpt4 book ai didi

python - ubuntu 12.04下无法安装MySQL-python

转载 作者:行者123 更新时间:2023-11-29 23:10:00 25 4
gpt4 key购买 nike

我尝试在 virtualenv 环境下的 ubuntu 12.04 中安装 mysql-python 模块,但意外地遇到以下错误:

building '_mysql' extension

creating build/temp.linux-x86_64-2.7

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1

In file included from /usr/include/mysql/mysql.h:64:0,

from _mysql.c:46:

/usr/include/mysql/mysql/client_plugin.h:97:3: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

In file included from /usr/include/mysql/mysql.h:64:0,

from _mysql.c:46:

/usr/include/mysql/mysql/client_plugin.h:107:3: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib/x86_64-linux-gnu
-lmysqlclient_r -lpthread -lz -lm -lrt -ldl -o build/lib.linux-x86_64-2.7/_mysql.so

/usr/bin/ld: cannot find -lmysqlclient_r

collect2: ld returned 1 exit status

error: command 'gcc' failed with exit status 1

我跑过:

sudo apt-get install mysql-server mysql-client python-mysqldb libmysqlclient-dev python-dev

但这并没有帮助。

最佳答案

问题是 libmysqlclient.so 没有 https://github.com/javer/gentoo-overlay/issues/4#issuecomment-30748799 中描述的符号链接(symbolic link)

关于python - ubuntu 12.04下无法安装MySQL-python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28129521/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com