问题标签 [requirements.txt]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
282 浏览

python - 在 Heroku 上安装 iPython

要在我的本地机器上安装 iPython,我需要做:

如何在 Heroku 服务器的 requirements.txt 中指定这个 [all] 要求?

0 投票
1 回答
235 浏览

virtualenv - 虚拟环境要求.txt

我想在我的虚拟环境中放置一个 requirements.txt 文件。我想到的两种方法是制作一个 txt 文件,然后将其移动到正确的目录(我不知道如何找到该目录:当我键入 workon 时,PathToScripts 和 PathToSitePackages 说 C:\Users\A.virtualenvs。 ..) 并在我进入目录后创建一个 requirements.txt 文件(我不知道如何在正确的目录中创建文件)。我的任何想法都是解决这个问题的好方法吗?有一个更好的方法吗?

0 投票
1 回答
1799 浏览

python - 我是否总是需要重建 docker 才能安装新的 pip 包?

我注意到当我尝试使用 docker(主要是图)安装一个新的 pip 包时,它实际上并没有在系统上维护。我必须从 requirements.txt 重建和安装 pip 包

我尝试运行fig run web pip install django并且看到包安装,但是每次我运行命令时它都会重新安装而不提示升级(所以我知道包安装没有坚持)

这只是Docker的继承设计吗?我很困惑为什么总是需要建造

0 投票
0 回答
100 浏览

python - 尝试在 requirements.txt 中安装新版本的包

我正在使用最近更新的 Django 应用程序。我把这个新的包信息放在我的 requirements.txt 文件中,它安装正确。但是,我无法让我的数据库注册它(我使用的是 Django 1.5.8)。该应用程序的新版本包含一个新字段,并且该列未添加到我的数据库中。我正在使用 South 并进行了架构迁移。我也尝试过迁移和使用 syncdb 命令,但我不断收到此错误:

关于如何解决这个问题的任何想法?如何添加此新列?

0 投票
1 回答
84 浏览

python - Django 在服务器中失败

我看不到发生了什么。
我把输出git push heroku master用于分析。
当我这样做时pip freeze > requirements.txt,它会产生一个非常大的文件,我不知道这是否正常。

该应用程序在本地和开发模式下运行良好。

Procfile 是:
web: gunicorn losbarkitos.wsgi --log-file -

生成的“requirements.txt”如下(我觉得太长了):

我不明白,它在本地运行良好,但是当我启动应用程序时失败。

0 投票
1 回答
5610 浏览

python - 为 pip 格式化 requirements.txt 文件,其中一个或多个包具有不同的 index-url

我正在尝试将 Django 应用程序部署到 Heroku,其中一个必需的包位于https://testpypi.python.org/pypi其中,当然 Django 位于主 PyPI 服务器上。

requirements.txt文件如下所示:

运行pip install -r requirements.txt失败并出现以下错误:

所以看起来pip是在试图找到 Djangotestpypi

所以我尝试了这个:

它会导致相同的错误。

如果我在需求文件中只放置一个(不管是一个)包,pip 就能够找到该包并安装它。

问题:index-url在命令可以读取的单个文件中指定多个不同参数的正确语法是什么pip install -r file

我认为这并不重要,但 python 是 3.4.0 版本, pip 是 version pip 1.5.2

我已将 pip 更新到 6.0.8 版,错误现在显示为:

0 投票
1 回答
3139 浏览

python - pip 需求文件:不安装依赖项

我正在使用一些 github django 包的前沿版本,这些版本具有我不想安装的依赖项。

在开发中,在我自己的计算机上,我可以pip install在命令行中使用并使用--no-dependencies标志。但是,我的测试和生产环境需要一个需求文件来进行部署。不幸的是,该--no-dependencies标志不能在需求文件中使用,如下所述:https ://pip.pypa.io/en/latest/reference/pip_install.html#requirements-file-format 。

有没有办法告诉 pip 在使用需求文件时不要安装依赖项?

0 投票
2 回答
2135 浏览

python - Global and local python installations, and accidentally running a requirements file outside of virtualenv

So I was googling an event where pip required sudo privileges,and I came across the following two threads What are the risks of running 'sudo pip'? and Is it acceptable & safe to run pip install under sudo?

The first thread talks about the security risk of running an unknown .py file with pip (makes sense), but from the second one I almost got the impression that there exists a global and local python installation that you should not mix up. I guess it makes it sense that you can have a global installation for all users and then maybe an appended path to local packages for each user, but is this true? (it would also make sense since ubuntu (which I'm using) has dependencies on certain python packages, so having a global root protected python directory would protect these). However, if this is true, I can't find the two separate directories. I tried

with both sudo and no sudo, and I got the exact same directories.

In any case, I think I'll move to pip virtualenv, but in that case I was wondering, what would happen if I accidentaly forgot to activate the environment and ran an exotic requirements.txt outside? Wouldn't that corrupt my standard user directory I'm trying so hard to keep clean (if that is so, is that revertible? I'm just thinking, it's only forgetting to type one commando, and then your python installation is messed up.)

0 投票
3 回答
51772 浏览

python - 如何创建 requirements.txt?

我想知道如何为我的 Python 3 应用程序创建一个合适的 requirements.txt?

0 投票
0 回答
88 浏览

python - 单个pip命令下载+保留+搜索+安装包

我有一个requirements.txt列出了几个依赖项的文件。

每当我pip install -r requirements.txt在一个全新的系统中尝试时,如果不满足某些依赖项,这通常会失败(参见例如:herehere)这特别发生在matplotlib包中。

在下载了整个包(matplotlib大约 50Mb)并且安装失败后,我去修复问题,然后再次尝试安装包。

pip似乎还不够聪明,无法意识到它只是下载了那个包并自动重新使用同一个文件(也许是因为它默认不保留副本?)所以包将被完全下载

为了解决这个问题,我可以按照此处给出的说明使用:

首先下载所有软件包,然后:

使用本地存储的文件安装所有软件包。

我的问题:是否有包含这两个指令的智能命令?我在单行之后,我可以重复运行,以便它将使用存储的包副本(如果存在),或者下载它们(如果不存在),在最后一种情况下,将这些副本存储到某个位置,以便它们可以重新- 如果需要,稍后使用。