首页 > 解决方案 > 错误:找不到满足要求 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)

标签: pythondjangoheroku

解决方案


该错误是由于您的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/


推荐阅读