首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用pip设置django-nonrel

使用pip设置django-nonrel
EN

Stack Overflow用户
提问于 2013-01-29 15:05:09
回答 2查看 2.7K关注 0票数 0

我正在尝试以正确的方式安装django-nonrel -,并能够再现流程

我使用pip安装了django-nonrel,如下所示:

代码语言:javascript
复制
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冻结> req.txt):

代码语言:javascript
复制
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),并尝试使用requirements文件再次获得它

代码语言:javascript
复制
(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安装它们还是有意义的吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-01-29 23:14:25

问题是您的需求文件没有足够的信息。

例如,当您请求pip安装django-autoload时,它要做的就是查看该包的PyPI (并在找到PyPI条目后丢弃一些页面)。

如果您希望有一个需求文件,该文件可以像安装时一样下载这些包,那么也要这样做:告诉pip在哪里可以找到包。

创建一个需求文件,如:

代码语言:javascript
复制
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

或者,如果要从特定标记或提交安装,请执行以下操作:

代码语言:javascript
复制
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上阅读更多关于需求文件的信息

票数 4
EN

Stack Overflow用户

发布于 2013-01-29 17:30:29

如果您使用的是GAE,那么使用pip是没有意义的,因为您使用的所有包都需要在实际的GAE项目文件夹中。安装在系统或虚拟环境中的包不会上传到GAE生产服务器。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14585938

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档