2016-05-11 53 views
2

我想使用以下指導在Heroku上部署我的django應用程序:https://devcenter.heroku.com/articles/deploying-python。我到達那裏我必須創建和填充用下面的命令中的「requirements.txt」文件中的點:當在Heroku上部署Django應用程序時,pip install 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

這只是表示您的需求文件爲空。你必須把需求列表放在那裏! – e4c5

回答

3

pip install -r requirements.txt未填充requirements.txt - 它將其作爲要安裝的包的名稱來源讀取。進一步的細節見https://pip.pypa.io/en/stable/user_guide/#requirements-files

要將您當前安裝的軟件包列表捕獲到requirements.txt,請嘗試pip freeze > requirements.txt

相關問題