错误:找不到满足apturl == 0.5.2要求的版本(来自-r /tmp/build_97769b8b/requirements.txt(第2行))

时间:2020-10-02 21:02:11

标签: python django heroku

在部署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)

1 个答案:

答案 0 :(得分:0)

该错误是由于您的requiremets.txt文件引起的。因为pip试图从您提到的位置安装apturl软件包,而您在问题中提到的requirements.txt文件/tmp/build_97769b8b/requirements.txt(第2行)中提到了该文件。
因此,请编辑requirements.txt文件,仅使用apturl==0.5.2代替:
apturl==0.5.2 @/tmp/build_97769b8b/