Why does installing Graphite from GitHub result in a different installation directory than installing from PyPI?

Asked by Andrew Meyer on 2016-09-20

While attempting to automate installation of a Graphite server with Puppet, I noticed the following behavior:

When I install Carbon and Graphite Web from the default pip package repository, PyPI, the packages are installed by default to `/usr/local/lib/python2.7/dist-packages/`. For example:

    pip install carbon==0.9.15
    pip install graphite-web==0.9.15

results in packages installed to the following directories (on Ubuntu 16.04 LTS):

    /usr/local/lib/python2.7/dist-packages/carbon-0.9.15.dist-info/
    /usr/local/lib/python2.7/dist-packages/graphite_web-0.9.15.dist-info/

However, when I instead install the _exact_ same versions of Carbon and Graphite Web from GitHub:

    pip install https://github.com/graphite-project/carbon/tarball/0.9.15
    pip install https://github.com/graphite-project/graphite-web/tarball/0.9.15

The packages end up in `/opt/graphite`:

   /opt/graphite/webapp/graphite_web-0.9.15-py2.7.egg-info/
    /opt/graphite/lib/carbon-0.9.15-py2.7.egg-info/

Why is this? Why does it matter where I'm getting the package from given that I'm installing the exact same version of each package (0.9.15) each time? Is there a way to get the `/opt` style installation behavior using the regular PyPI packages?

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Jason Dixon
Solved:
2016-09-21
Last query:
2016-09-21
Last reply:
2016-09-21
Jason Dixon (jason-dixongroup) said : #1

See https://github.com/graphite-project/graphite-web/issues/1508.

Jason Dixon
Sent from my iPhone

> On Sep 20, 2016, at 5:22 PM, Andrew Meyer <email address hidden> wrote:
>
> New question #401544 on Graphite:
> https://answers.launchpad.net/graphite/+question/401544
>
> While attempting to automate installation of a Graphite server with Puppet, I noticed the following behavior:
>
> When I install Carbon and Graphite Web from the default pip package repository, PyPI, the packages are installed by default to `/usr/local/lib/python2.7/dist-packages/`. For example:
>
> pip install carbon==0.9.15
> pip install graphite-web==0.9.15
>
> results in packages installed to the following directories (on Ubuntu 16.04 LTS):
>
> /usr/local/lib/python2.7/dist-packages/carbon-0.9.15.dist-info/
> /usr/local/lib/python2.7/dist-packages/graphite_web-0.9.15.dist-info/
>
> However, when I instead install the _exact_ same versions of Carbon and Graphite Web from GitHub:
>
> pip install https://github.com/graphite-project/carbon/tarball/0.9.15
> pip install https://github.com/graphite-project/graphite-web/tarball/0.9.15
>
> The packages end up in `/opt/graphite`:
>
> /opt/graphite/webapp/graphite_web-0.9.15-py2.7.egg-info/
> /opt/graphite/lib/carbon-0.9.15-py2.7.egg-info/
>
> Why is this? Why does it matter where I'm getting the package from given that I'm installing the exact same version of each package (0.9.15) each time? Is there a way to get the `/opt` style installation behavior using the regular PyPI packages?
>
> --
> You received this question notification because your team graphite-dev
> is an answer contact for Graphite.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~graphite-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~graphite-dev
> More help : https://help.launchpad.net/ListHelp

Andrew Meyer (andrewm-bpi) said : #2

Thanks, that's very helpful.

Looks like that issue needs to be reopened, since the person who closed it incorrectly assumed that the problem not showing up on master was a result of the master branch containing some sort of fix, whereas in reality I'm guessing it has to do with the difference in the way pip handles installing from different sources, as I demonstrated in my original question.

Andrew Meyer (andrewm-bpi) said : #3

Oh, and just to clarify for future people arriving from Google. The temporary fix for this is to install graphite with `--no-binary=:all:`. E.g.:

    pip install graphite-web --no-binary=:all:

Jason Dixon (jason-dixongroup) said : #4

I've deleted the comment you're referring to but the resolution described in https://github.com/graphite-project/graphite-web/issues/1508#issuecomment-244383013 is still accurate. The problem is due to a behavioral change in pip. Down the road we intend to "fix" Graphite so that it works better with wheels and is not so statically tied to /opt/graphite. There's no point in reopening that issue.

Andrew Meyer (andrewm-bpi) said : #5

Ah okay. So basically this problem is the result of a larger issue with the way Graphite works with Wheels, and the linked issue will be fixed as part of a larger effort to resolve that underlying problem?

Best Jason Dixon (jason-dixongroup) said : #6

Basically, yeah. :)

Andrew Meyer (andrewm-bpi) said : #7

Thanks Jason Dixon, that solved my question.