点击安装uwsgi失败"找不到-lz"

时间:2013-09-13 02:25:42

标签: python fedora uwsgi

我想安装uwsgi,但我无法安装。它是一个Fedora 18 64位系统。 python是2.7版,yum install zlib说:Package zlib-1.2.7-9.fc18.x86_64 already installed and latest version

安装uwsgi时,这是输出的最后一块。

*** uWSGI linking ***

gcc -pthread -o /usr/bin/uwsgi -L/usr/lib64 core/utils.o core/protocol.o core/socket.o core/logging.o core/master.o core/master_utils.o core/emperor.o core/notify.o core/mule.o core/subscription.o core/stats.o core/sendfile.o core/async.o core/master_checks.o core/offload.o core/io.o core/static.o core/websockets.o core/spooler.o core/snmp.o core/exceptions.o core/config.o core/setup_utils.o core/clock.o core/init.o core/buffer.o core/reader.o core/writer.o core/alarm.o core/cron.o core/plugins.o core/lock.o core/cache.o core/daemons.o core/errors.o core/hash.o core/master_events.o core/chunked.o core/queue.o core/event.o core/signal.o core/strings.o core/progress.o core/timebomb.o core/ini.o core/fsmon.o core/rpc.o core/gateway.o core/loop.o core/cookie.o core/querystring.o core/rb_timers.o core/transformations.o core/uwsgi.o proto/base.o proto/uwsgi.o proto/http.o proto/fastcgi.o proto/scgi.o lib/linux_ns.o core/zlib.o core/yaml.o core/dot_h.o plugins/python/python_plugin.o plugins/python/pyutils.o plugins/python/pyloader.o plugins/python/wsgi_handlers.o plugins/python/wsgi_headers.o plugins/python/wsgi_subhandler.o plugins/python/web3_subhandler.o plugins/python/pump_subhandler.o plugins/python/gil.o plugins/python/uwsgi_pymodule.o plugins/python/profiler.o plugins/python/symimporter.o plugins/python/tracebacker.o plugins/gevent/gevent.o plugins/gevent/hooks.o plugins/ping/ping_plugin.o plugins/cache/cache.o plugins/nagios/nagios.o plu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../libz.so when searching for -lz

/bin/ld: skipping incompatible /lib/libz.so when searching for -lz

/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz

/bin/ld: cannot find -lz

collect2: error: ld returned 1 exit status

gins/rrdtool/rrdtool.o plugins/carbon/carbon.o plugins/rpc/rpc_plugin.o plugins/corerouter/cr_common.o plugins/corerouter/cr_map.o plugins/corerouter/corerouter.o plugins/fastrouter/fastrouter.o plugins/http/http.o plugins/http/keepalive.o plugins/http/https.o plugins/http/spdy3.o plugins/ugreen/ugreen.o plugins/signal/signal_plugin.o plugins/syslog/syslog_plugin.o plugins/rsyslog/rsyslog_plugin.o plugins/logsocket/logsocket_plugin.o plugins/router_uwsgi/router_uwsgi.o plugins/router_redirect/router_redirect.o plugins/router_basicauth/router_basicauth.o plugins/zergpool/zergpool.o plugins/redislog/redislog_plugin.o plugins/mongodblog/mongodblog_plugin.o plugins/router_rewrite/router_rewrite.o plugins/router_http/router_http.o plugins/logfile/logfile.o plugins/router_cache/router_cache.o plugins/rawrouter/rawrouter.o plugins/router_static/router_static.o plugins/sslrouter/sslrouter.o plugins/spooler/spooler_plugin.o plugins/cheaper_busyness/cheaper_busyness.o plugins/symcall/symcall_plugin.o plugins/transformation_tofile/tofile.o plugins/transformation_gzip/gzip.o plugins/transformation_chunked/chunked.o plugins/transformation_offload/offload.o plugins/router_memcached/router_memcached.o plugins/router_redis/router_redis.o plugins/router_hash/router_hash.o plugins/router_expires/expires.o -lpthread -lm -rdynamic -ldl -lz -lpthread -ldl -lutil -lm -lpython2.7 -lcrypt

*** error linking uWSGI ***

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-QEHDKx-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/uwsgi
Storing complete log in /root/.pip/pip.log

2 个答案:

答案 0 :(得分:2)

首先,请确保已安装python-dev

接下来,安装zlib-devel

yum install -y python-dev zlib-devel

答案 1 :(得分:1)

首先,我不担心:

/bin/ld: skipping incompatible /lib/libz.so when searching for -lz
/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz

它们只是出现,因为-L 将一个目录添加到库搜索路径,所以它仍在检查32位区域(并忽略它们)。

但是,根据RPM search page for your package,仅提供以下文件:

  • /usr/lib64/libz.so.1
  • /usr/lib64/libz.so.1.2.7
  • /usr/share/doc/zlib-1.2.7
  • /usr/share/doc/zlib-1.2.7/ChangeLog
  • /usr/share/doc/zlib-1.2.7/FAQ
  • /usr/share/doc/zlib-1.2.7/README

您可能需要检查该目录,以查看libz.so条目是否有libz.so.1软链接。如果没有,请使用如下命令创建一个:

ln -s /usr/lib64/libz.so.1 /usr/lib64/libz.so

(你可能需要是root用户)。查看libz中的/lib内容应该会显示它应该是什么样的内容,例如:

lrwxrwxrwx 1 root root 18 Apr 24  2012 libxyzzy.so -> libxyzzy.so.2.1.0