13

I'm trying to figure out how I can install a python package that doesn't have a setup.py file with pip. (package in question is http://code.google.com/p/django-google-analytics/)

Normally I would just checkout the code from the repo and symlink into my site-packages, but I'm trying to get my whole environment frozen into a pip requirements file for easy deployment and testing.

Any ideas?

Craig McQueen
  • 41,871
  • 30
  • 130
  • 181
erikcw
  • 10,787
  • 15
  • 58
  • 75
  • "Normally I would just checkout the code from the repo and symlink into my site-packages". To be clear, normally you do not use `setup.py`? If you normally do not use `setup.py`, and this doesn't have `setup.py`, what's the question? – S.Lott Feb 05 '10 at 11:44
  • 4
    @S.Lott I think that was pretty well explained by the second half of the sentence. – Carl Meyer Feb 05 '10 at 20:01
  • @Carl Meyer: Just to be clear: It wasn't clear to me. So I have to ask. I can't follow the question because it's too terse. The question is both about using setup.py and not using setup.py. I'm unable to follow it. – S.Lott Feb 06 '10 at 01:07

2 Answers2

15

Fork the repo and add a working setup.py. Then send a pull request to the author.

Oh, it's on Google Code. Well then, file a bug and post a patch.

If the author refuses to make their code into an installable Python distribution (never happened to me), just host your fork somewhere and put that in your requirements file.

Carl Meyer
  • 122,012
  • 20
  • 106
  • 116
7

You can't. PIP installs Python packages. That's not a Python package. I've heard that the Django community in general doesn't make much packages, which makes things like what you are trying to do tricky. But that could be wrong.

If you want to freeze your environment you might want to look into Buildout. Other options in this case is to use an svn:external.

Lennart Regebro
  • 167,292
  • 41
  • 224
  • 251
  • 3
    Used to be more true than it is now (re the Django community). These days a much higher proportion of Django reusable apps in the wild (well, the decent ones anyway) are proper packages. Er, distributions. Whatever ;-) – Carl Meyer Feb 05 '10 at 19:57