python - 错误:找不到满足要求 apturl==0.5.2 的版本(来自 -r /tmp/build_97769b8b/requirements.txt(第 2 行))
问题描述
在部署我的 Django 应用程序 Heroku 时,它显示了这个错误,尽管我手动安装它时已经满足了所有要求,我的操作系统是 ubuntu 20,使用 pip3 进行安装,Django 3.0.1
git push heroku master
Enumerating objects: 88, done.
Counting objects: 100% (88/88), done.
Delta compression using up to 4 threads
Compressing objects: 100% (80/80), done.
Writing objects: 100% (88/88), 926.04 KiB | 10.18 MiB/s, done.
Total 88 (delta 25), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! Python has released a security update! Please consider upgrading to python-3.8.6
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.8.2
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting appdirs==1.4.4
remote: Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
remote: ERROR: Could not find a version that satisfies the requirement apturl==0.5.2 (from -r /tmp/build_97769b8b/requirements.txt (line 2)) (from versions: none)
remote: ERROR: No matching distribution found for apturl==0.5.2 (from -r /tmp/build_97769b8b/requirements.txt (line 2))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to mygamlaapp.
remote:
To https://git.heroku.com/mygamlaapp.git
! [remote rejected] master -> master (pre-receive hook declined)
解决方案
该错误是由于您的requiremets.txt
文件引起的。因为pip
正在尝试apturl
从您提到的位置安装软件包,该位置在您的问题中提到的requirements.txt
(第 2 行)文件中/tmp/build_97769b8b/requirements.txt
提到。
所以编辑你的requirements.txt
文件,只使用apturl==0.5.2
而不是:
apturl==0.5.2 @/tmp/build_97769b8b/
推荐阅读
- javascript - 如何更新 nodejs 文件的内容?
- javascript - Javascript文本输入设备
- docfx - 如何配置 DocFX 以增加有关方法参数的文档的列宽?
- python - python中stdnum.isin.is_valid()函数的KeyError
- c# - 为什么对托管 c++ 类的调用不等待它完成?
- android - 如何在 UML 序列图和类图中表示一个活动以意图启动另一个活动?
- python - 创建的函数未进入while循环
- docker - 如何在私有注册表中运行 docker 镜像
- python - 如何在 python 中使用“IN”查询 sqlalchemy 对象?
- machine-learning - 为什么 LSTM 遗忘门会接受新的输入?