0

CentOS release 6.5 (Final).

Python 2.7.5 using 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-tools installed.

This is the output from trying to install 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

Can anyone help?

skyler
  • 8,010
  • 15
  • 46
  • 69

4 Answers4

4

What worked for me was to install the previous version of pylibmc. Version 1.3.0 was failing to install so I fell back to 1.2.3

pip install pylibmc==1.2.3

as far as I can tell pip doesn't have a great way of showing available packages, there's yolk but it seems to only list pylibmc==1.3.0. I'm sure there is a better way, but running install with a high number (unlikely to have an actual install candidate) and it will output the possibilities. Please let me know if you know a better way.

# 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
Chris Montanaro
  • 16,948
  • 4
  • 20
  • 29
2

I ended up downloading the latest source from https://launchpad.net/libmemcached/+download and then doing a ./configure;make;make install

dan
  • 982
  • 8
  • 24
1

I had similar problem today on my CentOS box . Solved it by installing libmemcached-last and libmemcached-last-devel from EPEL repo .

Alexander
  • 12,424
  • 5
  • 59
  • 76
  • There is libmemcached-last in EPEL at least for EL6 (which the question is about). Which release are you using? – 02strich Jul 18 '14 at 12:08
1

Everyone seems to need something a little different! On Red Hat EL 6.5 I needed to install the IUS repository on top of EPEL. The same repo is available for CentOS 6.5 too. This allowed me to install libmemcached 1.0.16.

From Rackspace's guide, to install IUS:

# First install EPEL
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6*.rpm
# Then install IUS for RHEL 6.5
wget http://dl.iuscommunity.org/pub/ius/stable/RedHat/6/x86_64/ius-release-1.0-13.ius.el6.noarch.rpm
sudo rpm -Uvh ius-release*.rpm
# Or for CentOS 6.5
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-13.ius.centos6.noarch.rpm
sudo rpm -Uvh ius-release*.rpm

After that I could install a newer libmemcached (note the different package name):

sudo yum install libmemcached10
sudo yum install libmemcached10-devel

And after that the latest version of pylibmc installed like a charm with:

pip install pylibmc
foz
  • 3,121
  • 1
  • 27
  • 21
  • what was the pylibmc version you successfully installed at the time? I am seeing failures while attempting to install pylibmc version 1.3 – Priyeshj May 02 '16 at 18:38
  • 1
    Hi @Priyeshj this was for pylibmc 1.4.2 on the distro standard Python 2.6. I've just seen that pylibmc 1.5 "fixes critical memory leaks in common code paths introduced in 1.4.2" so it looks like 1.4.2 is not a preferred version! – foz May 03 '16 at 10:20