简体   繁体   English

PIP安装没有setup.py文件的Python包?

[英]PIP install a Python Package without a setup.py file?

I'm trying to figure out how I can install a python package that doesn't have a setup.py file with pip . 我试图找出如何安装没有带有pipsetup.py文件的python包。 (package in question is http://code.google.com/p/django-google-analytics/ ) (有问题的包是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. 通常我会将repo和符号链接中的代码签出到我的站点包中,但我试图将整个环境冻结成一个pip需求文件,以便于部署和测试。

Any ideas? 有任何想法吗?

Fork the repo and add a working setup.py. fork the repo并添加一个正常工作的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. 如果作者拒绝将他们的代码变成可安装的Python发行版(从未发生在我身上),只需在某处托管你的fork并将其放在你的需求文件中。

You can't. 你不能。 PIP installs Python packages. PIP安装Python包。 That's not a Python package. 那不是Python包。 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. 我听说Django社区一般没有多少包,这使得你想要做的事情变得棘手。 But that could be wrong. 但那可能是错的。

If you want to freeze your environment you might want to look into Buildout . 如果要冻结环境,可能需要查看Buildout Other options in this case is to use an svn:external. 在这种情况下的其他选项是使用svn:external。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM