Пип не может установить pylibmc

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

@ средства разработки установлены.

Это результат попытки установить 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

Кто-нибудь может помочь?

4 ответа

Для меня работало установить предыдущую версию pylibmc. Версия 1.3.0 не удалось установить, поэтому я вернулся к 1.2.3

pip install pylibmc==1.2.3

насколько я могу судить, у pip нет отличного способа показать доступные пакеты, есть желток, но, похоже, он перечисляет только pylibmc==1.3.0. Я уверен, что есть лучший способ, но запуск установки с большим числом (вряд ли будет иметь реальный кандидат на установку), и он выведет возможности. Пожалуйста, дайте мне знать, если вы знаете лучший способ.

# 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

В итоге я скачал последний источник с https://launchpad.net/libmemcached/+download а затем выполнил установку./configure;make;make

Кажется, каждому нужно что-то немного другое! В Red Hat EL 6.5 мне нужно было установить репозиторий IUS поверх EPEL. Такое же репо доступно и для CentOS 6.5. Это позволило мне установить libmemcached 1.0.16.

Из руководства Rackspace, чтобы установить 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

После этого я могу установить более новую версию libmemcached (обратите внимание на другое имя пакета):

sudo yum install libmemcached10
sudo yum install libmemcached10-devel

И после этого последняя версия pylibmc установлена ​​как шарм с:

pip install pylibmc

У меня была похожая проблема сегодня на моей коробке CentOS. Решил это установкой libmemcached-last а также libmemcached-last-devel из репо EPEL.

Другие вопросы по тегам