CentOS版本6.5 (最终版)。
Python 2.7.5使用Virtualenv。
> rpm -qa '*memcache*'
libmemcached-devel-0.31-1.1.el6.x86_64
libmemcached-0.31-1.1.el6.x86_64
libmemcache-devel-1.4.0-0.1.rc2.el6.rf.x86_64
libmemcache-1.4.0-0.1.rc2.el6.rf.x86_64@development-工具已安装。
这是尝试安装pylibmc的输出
> pip install pylibmc
Downloading/unpacking pylibmc
Running setup.py egg_info for package pylibmc
warning: no files found matching 'LICENSE'
warning: no files found matching 'runtests.py'
warning: no files found matching '*.py' under directory 'pylibmc'
Installing collected packages: pylibmc
Running setup.py install for pylibmc
building '_pylibmc' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/usr/local/include/python2.7 -c src/_pylibmcmodule.c -o build/temp.
In file included from src/_pylibmcmodule.c:34:
src/_pylibmcmodule.h:189: error: ‘MEMCACHED_BEHAVIOR_TCP_KEEPALIVE’ undeclared here (not in a function)
src/_pylibmcmodule.h:256: error: ‘MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY’ undeclared here (not in a function)
src/_pylibmcmodule.h:256: error: initializer element is not constant
src/_pylibmcmodule.h:256: error: (near initialization for ‘PylibMC_distributions[3].flag’)
src/_pylibmcmodule.h:261: error: ‘MEMCACHED_DISTRIBUTION_CONSISTENT_MAX’ undeclared here (not in a function)
src/_pylibmcmodule.h:261: error: initializer element is not constant
src/_pylibmcmodule.h:261: error: (near initialization for ‘PylibMC_distributions[5].flag’)
src/_pylibmcmodule.c: In function ‘PylibMC_Client_gets’:
src/_pylibmcmodule.c:571: warning: passing argument 2 of ‘memcached_mget’ from incompatible pointer type
/usr/include/libmemcached/memcached_get.h:25: note: expected ‘char **’ but argument is of type ‘const char **’
src/_pylibmcmodule.c: In function ‘pylibmc_memcached_fetch_multi’:
src/_pylibmcmodule.c:1375: warning: passing argument 2 of ‘memcached_mget’ from incompatible pointer type
/usr/include/libmemcached/memcached_get.h:25: note: expected ‘char **’ but argument is of type ‘const char **’
error: command 'gcc' failed with exit status 1
Complete output from command /home/vagrant/.virtualenvs/cfft2.7/bin/python2.7 -c "import setuptools;__file__='/home/vagrant/.virtualenvs/cfft2.7/build/pylibmc/setup.py';exec(com
running install
running build
running build_py
running build_ext
building '_pylibmc' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/usr/local/include/python2.7 -c src/_pylibmcmodule.c -o build/temp.linu
In file included from src/_pylibmcmodule.c:34:
src/_pylibmcmodule.h:189: error: ‘MEMCACHED_BEHAVIOR_TCP_KEEPALIVE’ undeclared here (not in a function)
src/_pylibmcmodule.h:256: error: ‘MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY’ undeclared here (not in a function)
src/_pylibmcmodule.h:256: error: initializer element is not constant
src/_pylibmcmodule.h:256: error: (near initialization for ‘PylibMC_distributions[3].flag’)
src/_pylibmcmodule.h:261: error: ‘MEMCACHED_DISTRIBUTION_CONSISTENT_MAX’ undeclared here (not in a function)
src/_pylibmcmodule.h:261: error: initializer element is not constant
src/_pylibmcmodule.h:261: error: (near initialization for ‘PylibMC_distributions[5].flag’)
src/_pylibmcmodule.c: In function ‘PylibMC_Client_gets’:
src/_pylibmcmodule.c:571: warning: passing argument 2 of ‘memcached_mget’ from incompatible pointer type
/usr/include/libmemcached/memcached_get.h:25: note: expected ‘char **’ but argument is of type ‘const char **’
src/_pylibmcmodule.c: In function ‘pylibmc_memcached_fetch_multi’:
src/_pylibmcmodule.c:1375: warning: passing argument 2 of ‘memcached_mget’ from incompatible pointer type
/usr/include/libmemcached/memcached_get.h:25: note: expected ‘char **’ but argument is of type ‘const char **’
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /home/vagrant/.virtualenvs/cfft2.7/bin/python2.7 -c "import setuptools;__file__='/home/vagrant/.virtualenvs/cfft2.7/build/pylibmc/setup.py';exec(compile(open(__file__).read(
Storing complete log in /home/vagrant/.pip/pip.log有人能帮上忙吗?
发布于 2014-10-31 05:56:40
对我来说起作用的是安装了pylibmc的早期版本。1.3.0版本安装失败,所以我又回到了1.2.3版本
pip install pylibmc==1.2.3据我所知,pip没有一个很好的方式来显示可用的包,虽然有yolk,但它似乎只列出了pylibmc==1.3.0。我确信有一种更好的方法,但是用一个很高的数字运行install (不太可能有一个实际的候选安装),它将输出可能的结果。如果你知道更好的方法,请告诉我。
# pip install pylibmc==12222222
Downloading/unpacking pylibmc==12222222
Could not find a version that satisfies the requirement pylibmc==12222222 (from versions: 0.2, 0.3, 0.4, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.5, 0.6.1, 0.6, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7, 0.8.1, 0.8.2, 0.8, 0.9.1, 0.9.2, 0.9, 1.0-alpha, 1.0-beta, 1.0, 1.1.1, 1.1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0)
No distributions matching the version for pylibmc==12222222
Storing complete log in /root/.pip/pip.log发布于 2014-08-13 05:56:21
我最终从https://launchpad.net/libmemcached/+download下载了最新的源代码,然后执行了./configure;make;make install
发布于 2014-07-07 19:55:22
我今天在我的CentOS机器上也遇到了类似的问题。通过安装EPEL repo中的libmemcached-last和libmemcached-last-devel解决了这个问题。
https://stackoverflow.com/questions/24437325
复制相似问题