在Heroku上部署Django应用程序时pip install requirements.txt问题

时间:2016-05-11 10:52:56

标签: python django heroku pip

我正在尝试使用以下指南在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文件?感谢。

1 个答案:

答案 0 :(得分:5)

pip install -r requirements.txt不会填充requirements.txt - 它会将其读作要安装的软件包的名称来源。有关详细信息,请参阅https://pip.pypa.io/en/stable/user_guide/#requirements-files

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