Назад | Перейти на главную страницу

'pip install carbon' выглядит так, как будто он работает, но потом pip не соглашается

Я пытаюсь использовать pip установить пакет carbon, пакет, связанный со сбором статистики. Когда я бегу pip install carbon, вроде все работает. Тем не мение, pip не уверен, что пакет действительно установлен. (Это в конечном итоге вызывает проблемы, потому что я использую Puppet, и у меня есть правило устанавливать углерод, используя pip, и когда марионетка спрашивает pip "этот пакет установлен?" он говорит "нет" и переустанавливает его снова.)

Как мне выяснить, что мешает pip распознать успешную установку?

Вот результат обычной установки:

root@statsd:/opt/graphite# pip install carbon
Downloading/unpacking carbon
  Downloading carbon-0.9.9.tar.gz
  Running setup.py egg_info for package carbon

    package init file 'lib/twisted/plugins/__init__.py' not found (or not a regular file)
Requirement already satisfied (use --upgrade to upgrade): twisted in /usr/local/lib/python2.7/dist-packages (from carbon)
Requirement already satisfied (use --upgrade to upgrade): txamqp in /usr/local/lib/python2.7/dist-packages (from carbon)
Requirement already satisfied (use --upgrade to upgrade): zope.interface in /usr/local/lib/python2.7/dist-packages (from twisted->carbon)
Requirement already satisfied (use --upgrade to upgrade): distribute in /usr/local/lib/python2.7/dist-packages (from zope.interface->twisted->carbon)
Installing collected packages: carbon
  Running setup.py install for carbon
    package init file 'lib/twisted/plugins/__init__.py' not found (or not a regular file)
    changing mode of build/scripts-2.7/validate-storage-schemas.py from 664 to 775
    changing mode of build/scripts-2.7/carbon-aggregator.py from 664 to 775
    changing mode of build/scripts-2.7/carbon-cache.py from 664 to 775
    changing mode of build/scripts-2.7/carbon-relay.py from 664 to 775
    changing mode of build/scripts-2.7/carbon-client.py from 664 to 775

    changing mode of /opt/graphite/bin/validate-storage-schemas.py to 775
    changing mode of /opt/graphite/bin/carbon-aggregator.py to 775
    changing mode of /opt/graphite/bin/carbon-cache.py to 775
    changing mode of /opt/graphite/bin/carbon-relay.py to 775
    changing mode of /opt/graphite/bin/carbon-client.py to 775
Successfully installed carbon
Cleaning up...
root@statsd:/opt/graphite# pip freeze | grep carbon
root@statsd:

Вот подробный вариант установки:

root@statsd:/opt/graphite# pip install carbon -v
Downloading/unpacking carbon
  Using version 0.9.9 (newest of versions: 0.9.9, 0.9.9, 0.9.8, 0.9.7, 0.9.6, 0.9.5)
  Downloading carbon-0.9.9.tar.gz
  Running setup.py egg_info for package carbon
    running egg_info
    creating pip-egg-info/carbon.egg-info
    writing requirements to pip-egg-info/carbon.egg-info/requires.txt
    writing pip-egg-info/carbon.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/carbon.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/carbon.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/carbon.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    package init file 'lib/twisted/plugins/__init__.py' not found (or not a regular file)
    reading manifest file 'pip-egg-info/carbon.egg-info/SOURCES.txt'
    writing manifest file 'pip-egg-info/carbon.egg-info/SOURCES.txt'
Requirement already satisfied (use --upgrade to upgrade): twisted in /usr/local/lib/python2.7/dist-packages (from carbon)
Requirement already satisfied (use --upgrade to upgrade): txamqp in /usr/local/lib/python2.7/dist-packages (from carbon)
Requirement already satisfied (use --upgrade to upgrade): zope.interface in /usr/local/lib/python2.7/dist-packages (from twisted->carbon)
Requirement already satisfied (use --upgrade to upgrade): distribute in /usr/local/lib/python2.7/dist-packages (from zope.interface->twisted->carbon)
Installing collected packages: carbon
  Running setup.py install for carbon
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-i686-2.7
    creating build/lib.linux-i686-2.7/carbon
    copying lib/carbon/amqp_publisher.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/manhole.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/instrumentation.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/cache.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/management.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/relayrules.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/events.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/protocols.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/conf.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/rewrite.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/hashing.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/writer.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/client.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/util.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/service.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/amqp_listener.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/routers.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/storage.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/log.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/__init__.py -> build/lib.linux-i686-2.7/carbon
    copying lib/carbon/state.py -> build/lib.linux-i686-2.7/carbon
    creating build/lib.linux-i686-2.7/carbon/aggregator
    copying lib/carbon/aggregator/receiver.py -> build/lib.linux-i686-2.7/carbon/aggregator
    copying lib/carbon/aggregator/rules.py -> build/lib.linux-i686-2.7/carbon/aggregator
    copying lib/carbon/aggregator/buffers.py -> build/lib.linux-i686-2.7/carbon/aggregator
    copying lib/carbon/aggregator/__init__.py -> build/lib.linux-i686-2.7/carbon/aggregator
    package init file 'lib/twisted/plugins/__init__.py' not found (or not a regular file)
    creating build/lib.linux-i686-2.7/twisted
    creating build/lib.linux-i686-2.7/twisted/plugins
    copying lib/twisted/plugins/carbon_relay_plugin.py -> build/lib.linux-i686-2.7/twisted/plugins
    copying lib/twisted/plugins/carbon_aggregator_plugin.py -> build/lib.linux-i686-2.7/twisted/plugins
    copying lib/twisted/plugins/carbon_cache_plugin.py -> build/lib.linux-i686-2.7/twisted/plugins
    copying lib/carbon/amqp0-8.xml -> build/lib.linux-i686-2.7/carbon
    running build_scripts
    creating build/scripts-2.7
    copying and adjusting bin/validate-storage-schemas.py -> build/scripts-2.7
    copying and adjusting bin/carbon-aggregator.py -> build/scripts-2.7
    copying and adjusting bin/carbon-cache.py -> build/scripts-2.7
    copying and adjusting bin/carbon-relay.py -> build/scripts-2.7
    copying and adjusting bin/carbon-client.py -> build/scripts-2.7
    changing mode of build/scripts-2.7/validate-storage-schemas.py from 664 to 775
    changing mode of build/scripts-2.7/carbon-aggregator.py from 664 to 775
    changing mode of build/scripts-2.7/carbon-cache.py from 664 to 775
    changing mode of build/scripts-2.7/carbon-relay.py from 664 to 775
    changing mode of build/scripts-2.7/carbon-client.py from 664 to 775
    running install_lib
    copying build/lib.linux-i686-2.7/carbon/amqp_publisher.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/manhole.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/amqp0-8.xml -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/instrumentation.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/cache.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/management.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/relayrules.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/events.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/protocols.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/conf.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/rewrite.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/hashing.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/writer.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/client.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/util.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/aggregator/receiver.py -> /opt/graphite/lib/carbon/aggregator
    copying build/lib.linux-i686-2.7/carbon/aggregator/rules.py -> /opt/graphite/lib/carbon/aggregator
    copying build/lib.linux-i686-2.7/carbon/aggregator/buffers.py -> /opt/graphite/lib/carbon/aggregator
    copying build/lib.linux-i686-2.7/carbon/aggregator/__init__.py -> /opt/graphite/lib/carbon/aggregator
    copying build/lib.linux-i686-2.7/carbon/service.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/amqp_listener.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/routers.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/storage.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/log.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/__init__.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/carbon/state.py -> /opt/graphite/lib/carbon
    copying build/lib.linux-i686-2.7/twisted/plugins/carbon_relay_plugin.py -> /opt/graphite/lib/twisted/plugins
    copying build/lib.linux-i686-2.7/twisted/plugins/carbon_aggregator_plugin.py -> /opt/graphite/lib/twisted/plugins
    copying build/lib.linux-i686-2.7/twisted/plugins/carbon_cache_plugin.py -> /opt/graphite/lib/twisted/plugins
    byte-compiling /opt/graphite/lib/carbon/amqp_publisher.py to amqp_publisher.pyc
    byte-compiling /opt/graphite/lib/carbon/manhole.py to manhole.pyc
    byte-compiling /opt/graphite/lib/carbon/instrumentation.py to instrumentation.pyc
    byte-compiling /opt/graphite/lib/carbon/cache.py to cache.pyc
    byte-compiling /opt/graphite/lib/carbon/management.py to management.pyc
    byte-compiling /opt/graphite/lib/carbon/relayrules.py to relayrules.pyc
    byte-compiling /opt/graphite/lib/carbon/events.py to events.pyc
    byte-compiling /opt/graphite/lib/carbon/protocols.py to protocols.pyc
    byte-compiling /opt/graphite/lib/carbon/conf.py to conf.pyc
    byte-compiling /opt/graphite/lib/carbon/rewrite.py to rewrite.pyc
    byte-compiling /opt/graphite/lib/carbon/hashing.py to hashing.pyc
    byte-compiling /opt/graphite/lib/carbon/writer.py to writer.pyc
    byte-compiling /opt/graphite/lib/carbon/client.py to client.pyc
    byte-compiling /opt/graphite/lib/carbon/util.py to util.pyc
    byte-compiling /opt/graphite/lib/carbon/aggregator/receiver.py to receiver.pyc
    byte-compiling /opt/graphite/lib/carbon/aggregator/rules.py to rules.pyc
    byte-compiling /opt/graphite/lib/carbon/aggregator/buffers.py to buffers.pyc
    byte-compiling /opt/graphite/lib/carbon/aggregator/__init__.py to __init__.pyc
    byte-compiling /opt/graphite/lib/carbon/service.py to service.pyc
    byte-compiling /opt/graphite/lib/carbon/amqp_listener.py to amqp_listener.pyc
    byte-compiling /opt/graphite/lib/carbon/routers.py to routers.pyc
    byte-compiling /opt/graphite/lib/carbon/storage.py to storage.pyc
    byte-compiling /opt/graphite/lib/carbon/log.py to log.pyc
    byte-compiling /opt/graphite/lib/carbon/__init__.py to __init__.pyc
    byte-compiling /opt/graphite/lib/carbon/state.py to state.pyc
    byte-compiling /opt/graphite/lib/twisted/plugins/carbon_relay_plugin.py to carbon_relay_plugin.pyc
    byte-compiling /opt/graphite/lib/twisted/plugins/carbon_aggregator_plugin.py to carbon_aggregator_plugin.pyc
    byte-compiling /opt/graphite/lib/twisted/plugins/carbon_cache_plugin.py to carbon_cache_plugin.pyc
    running install_data
    copying conf/storage-schemas.conf.example -> /opt/graphite/conf
    copying conf/rewrite-rules.conf.example -> /opt/graphite/conf
    copying conf/relay-rules.conf.example -> /opt/graphite/conf
    copying conf/carbon.amqp.conf.example -> /opt/graphite/conf
    copying conf/aggregation-rules.conf.example -> /opt/graphite/conf
    copying conf/carbon.conf.example -> /opt/graphite/conf
    running install_egg_info
    running egg_info
    creating lib/carbon.egg-info
    writing requirements to lib/carbon.egg-info/requires.txt
    writing lib/carbon.egg-info/PKG-INFO
    writing top-level names to lib/carbon.egg-info/top_level.txt
    writing dependency_links to lib/carbon.egg-info/dependency_links.txt
    writing manifest file 'lib/carbon.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'lib/carbon.egg-info/SOURCES.txt'
    writing manifest file 'lib/carbon.egg-info/SOURCES.txt'
    removing '/opt/graphite/lib/carbon-0.9.9-py2.7.egg-info' (and everything under it)
    Copying lib/carbon.egg-info to /opt/graphite/lib/carbon-0.9.9-py2.7.egg-info
    running install_scripts
    copying build/scripts-2.7/validate-storage-schemas.py -> /opt/graphite/bin
    copying build/scripts-2.7/carbon-aggregator.py -> /opt/graphite/bin
    copying build/scripts-2.7/carbon-cache.py -> /opt/graphite/bin
    copying build/scripts-2.7/carbon-relay.py -> /opt/graphite/bin
    copying build/scripts-2.7/carbon-client.py -> /opt/graphite/bin
    changing mode of /opt/graphite/bin/validate-storage-schemas.py to 775
    changing mode of /opt/graphite/bin/carbon-aggregator.py to 775
    changing mode of /opt/graphite/bin/carbon-cache.py to 775
    changing mode of /opt/graphite/bin/carbon-relay.py to 775
    changing mode of /opt/graphite/bin/carbon-client.py to 775
    writing list of installed files to '/tmp/pip-9LuJTF-record/install-record.txt'
Successfully installed carbon
Cleaning up...
  Removing temporary dir /opt/graphite/build...
root@statsd:/opt/graphite# 

Для справки это pip 1.0 from /usr/lib/python2.7/dist-packages (python 2.7)

Я столкнулся с той же проблемой (установка на OSX, а не на марионетку), похоже, что она такая же, как на это обсуждение в списке рассылки марионеточных пользователей (и этот обходной путь на репо на углеродном github).

В моем случае решение заключалось в том, чтобы установить PYTHONPATH включать /opt/graphite/lib и /opt/graphite/webapp:

export PYTHONPATH=/opt/graphite/lib:/opt/graphite/webapp

Затем процесс установки завершится успешно и pip list показывает установлен карбон.

Не знаю, осталась ли у вас эта проблема, но вчера было то же самое. Вот как я решил эту проблему с марионеткой:

$graphite_version = '0.9.9'

exec {
  'install-carbon':
    command => "pip install carbon==${graphite_version}",
    creates => "/opt/graphite/lib/carbon-${graphite_version}-py2.6.egg-info";

  'install-graphite-web':
    command => "pip install graphite-web==${graphite_version}",
    creates => "/opt/graphite/webapp/graphite_web-${graphite_version}-py2.6.egg-info";
}

Это не решает проблему полностью (углерод и графит не регистрируются должным образом как установленные с помощью pip), но это означает, что ваша марионетка не переустанавливает их.

Надеюсь, это поможет,

Даз