【问题标题】:pip install requirements.txt issue when deploying Django app on Heroku在 Heroku 上部署 Django 应用程序时出现 pip install requirements.txt 问题
【发布时间】:2016-09-06 17:27:41
【问题描述】:

我正在尝试使用以下指导在 Heroku 上部署我的 django 应用程序:https://devcenter.heroku.com/articles/deploying-python。我已经到了必须使用以下命令创建和填充“requirements.txt”文件的地步:

$ pip install -r requirements.txt

但是,我收到以下错误消息

You must give at least one requirement to install (see "pip help install")

我尝试了另外两个命令

$ pip install -r requirements.txt requirements.txt
$ pip install --allow-all-external requirements.txt

但在这两种情况下,我都会收到以下错误

Collecting requirements.txt
/home/bastien/python/framework/scrapping/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/home/bastien/python/framework/scrapping/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning

您能否告诉我问题出在哪里,如何使用适当的命令行来解决它,或者是否有办法以任何其他方式填充 requirements.txt 文件?谢谢。

【问题讨论】:

  • 这仅仅意味着您的需求文件是空的。你必须把需求清单放在那里!

标签: python django heroku pip


【解决方案1】:

pip install -r requirements.txt 不会填充 requirements.txt - 它会将其读取为要安装的软件包名称的来源。详情请见https://pip.pypa.io/en/stable/user_guide/#requirements-files

要将您当前安装的软件包列表捕获到requirements.txt,请尝试pip freeze > requirements.txt

【讨论】:

    猜你喜欢
    • 2012-07-08
    • 2013-09-30
    • 2011-05-15
    • 1970-01-01
    • 2019-05-24
    • 2019-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多