gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 14:11:40 25 4
gpt4 key购买 nike

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

最佳答案

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

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

关于python - 在 Heroku 上部署 Django 应用程序时出现 pip install requirements.txt 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37160481/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com