我尝试以正确的方式安装django-nonrel - 并且能够重现该过程。
我已经使用pip安装了django-nonrel - 如下所示:
pip install git+https://github.com/django-nonrel/django-nonrel.git
pip install git+https://github.com/django-nonrel/django-dbindexer.git
pip install git+https://github.com/django-nonrel/django-permission-backend-nonrel
pip install hg+https://bitbucket.org/wkornewald/djangoappengine
pip install hg+https://bitbucket.org/wkornewald/djangotoolbox
pip install hg+https://bitbucket.org/twanschik/django-autoload
pip install hg+https://bitbucket.org/twanschik/nonrel-search/src
安装完成后,我收到了这个req.txt文件(pip freeze> req.txt):
Django==1.3.1
django-autoload==0.01
django-dbindexer==0.3
djangoappengine==1.0
djangotoolbox==0.9.2
nonrel-search==0.1
permission-backend-nonrel==0.1
wsgiref==0.1.2
但我无法使用我的req.txt文件来获取相同的内容。 如果我卸载一个软件包(例如django-autoload)并尝试使用需求文件再次获取它
(gae-first)bentzy@lama:~/.virtualenvs/gae-first$ pip uninstall django-autoload
Uninstalling django-autoload:
...
Successfully uninstalled django-autoload
(gae-first)bentzy@lama:~/.virtualenvs/gae-first$ pip install -r req.txt
Requirement already satisfied (use --upgrade to upgrade): Django==1.3.1 in ./lib/python2.7/site-packages (from -r req.txt (line 1))
Downloading/unpacking django-autoload==0.01 (from -r req.txt (line 2))
Could not find any downloads that satisfy the requirement django-autoload==0.01 (from -r req.txt (line 2))
No distributions at all found for django-autoload==0.01 (from -r req.txt (line 2))
Storing complete log in /home/bentzy/.pip/pip.log
为什么这些包不在pip存储库?
使用pip来安装它们仍然有意义吗?
答案 0 :(得分:4)
问题是您的需求文件没有足够的信息。
当您请求安装pip
时,django-autoload
将要执行的操作是查看该包的PyPI(并在找到PyPI条目后删除一些页面)。
如果你想要一个需要下载这些软件包的需求文件,就像你一个一个地安装一样,做同样的事情:告诉pip在哪里找到软件包。
创建一个需求文件,如:
git+https://github.com/django-nonrel/django-nonrel.git
git+https://github.com/django-nonrel/django-dbindexer.git
git+https://github.com/django-nonrel/django-permission-backend-nonrel
hg+https://bitbucket.org/wkornewald/djangoappengine
hg+https://bitbucket.org/wkornewald/djangotoolbox
hg+https://bitbucket.org/twanschik/django-autoload
hg+https://bitbucket.org/twanschik/nonrel-search/src
或者,如果您要从特定标记或提交安装,请执行:
git+https://github.com/django-nonrel/django-nonrel.git@1.3.1#egg=Django
在http://www.pip-installer.org/en/latest/logic.html#requirements-file-format
了解有关需求文件的详情答案 1 :(得分:0)