graphite-project / carbonate

Utilities for managing graphite clusters
MIT License
516 stars 80 forks source link

To able to run on Debian: pkg_resources.DistributionNotFound: carbon #24

Closed AlexRRR closed 10 years ago

AlexRRR commented 10 years ago

Hello! I want to try out the project it looks very useful, but so I have not been able to so far. I have installed whisper and carbon via pip, and I have tried to install carbonate via pip as well.

OS:

Distributor ID: Debian Description: Debian GNU/Linux 7.6 (wheezy) Release: 7.6 Codename: wheezy

PIP is installed via 'python-pip' debian package, so it is a pretty standard install:

/home/vagrant# pip --version
pip 1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
/home/vagrant# carbon-list
Traceback (most recent call last):
  File "/usr/local/bin/carbon-list", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: carbon

Am I missing something?

AlexRRR commented 10 years ago

I found the problem: the carbon package is installed by pip under /opt/graphite/lib and not /usr/local/lib/python2.7/dist-packages/ as it was expecting. After symlinking things, this works.

jssjr commented 10 years ago

Interesting. You shouldn't need to create symlinks to compensate for graphite/carbon installing its libraries in odd places because of https://github.com/jssjr/carbonate/blob/master/carbonate/cluster.py#L3-L4.

Glad you found a fix, though.

aruetten commented 10 years ago

I run into the same problem when I installed carbonate and carbon via pip. If carbon is installed via the debian package this problems seems not to be present.

The debian package has the following patch: http://sources.debian.net/src/graphite-carbon/0.9.12-3/debian/patches/disable_install_opt.patch

Could this be the a general solution for this issue? Would it make sense to include it upstream?

psych0d0g commented 10 years ago

had the same issue under debian, symlinking fixed it, thanks

jssjr commented 10 years ago

Yeah. This is gross. The debian package is removing the /opt/graphite prefix from setup so we're able to load all of carbonate's dependencies directly from the default sys.path. I made an attempt to fix this with https://github.com/jssjr/carbonate/pull/33. Do you mind giving that a shot to see if this fixes things more reliably?

jssjr commented 10 years ago

Should be fixed in #33