在将代码推送到Heroku之后,我得到了这样的错误:
Push语句(Input):
$ git push heroku master
推流后出错。一切都被正确地收集,直到numpy收集。在删除numpy之后,pandas(输出)也出现了同样的问题:
remote: ERROR: Could not find a version that satisfies the requirement numpy==1.20.1 (from -r /tmp/build_52cd8b55/requirements.txt (line 18)) (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0rc1, 1.17.0rc2, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0rc1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0rc1, 1.19.0rc2, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5)
remote: ERROR: No matching distribution found for numpy==1.20.1 (from -r /tmp/build_52cd8b55/requirements.txt (line 18))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 647088494036f734167427e0eeb869a73026b09c
remote: !
remote: ! We have detected that you have triggered a build from source code with version 647088494036f734167427e0eeb869a73026b09c
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to test_project
remote:
To https://git.heroku.com/test_project.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/test_project.git'
在我的requirements.txt下面
dash==1.19.0
dash-core-components==1.15.0
dash-html-components==1.1.2
dash-pivottable==0.0.2
dash-renderer==1.9.0
dash-table==4.11.2
et-xmlfile==1.0.1
Flask==1.1.2
Flask-Compress==1.9.0
future==0.18.2
gunicorn==20.0.4
itsdangerous==1.1.0
jdcal==1.4.1
Jinja2==2.11.3
MarkupSafe==1.1.1
numpy==1.20.1
openpyxl==3.0.6
pandas==1.2.3
plotly==4.8.0
python-dateutil==2.8.1
pytz==2021.1
retrying==1.3.3
six==1.15.0
Werkzeug==1.0.1
然而,pandas和numpy已经满足了。我之前已经通过pip安装了它们。当我从requirements.txt中删除pandas和numpy时,代码会成功推送,但最终我无法打开heroku应用程序,因为出现了一个错误,即没有安装pandas和numpy库,尽管我已经通过pip安装了它们。有没有人能帮我把代码推到Heroku上,这样我就可以在Heroku域上打开一个应用了?
所有要求均已安装:
(venv) (base) i@MacBook-Pro-I Heroku_test_project % pip install -r requirements.txt
Requirement already satisfied: Brotli==1.0.9 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (1.0.9)
Requirement already satisfied: click==7.1.2 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (7.1.2)
Requirement already satisfied: dash==1.19.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (1.19.0)
Requirement already satisfied: dash-core-components==1.15.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 4)) (1.15.0)
Requirement already satisfied: dash-html-components==1.1.2 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 5)) (1.1.2)
Requirement already satisfied: dash-pivottable==0.0.2 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 6)) (0.0.2)
Requirement already satisfied: dash-renderer==1.9.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 7)) (1.9.0)
Requirement already satisfied: dash-table==4.11.2 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 8)) (4.11.2)
Requirement already satisfied: et-xmlfile==1.0.1 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 9)) (1.0.1)
Requirement already satisfied: Flask==1.1.2 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 10)) (1.1.2)
Requirement already satisfied: Flask-Compress==1.9.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 11)) (1.9.0)
Requirement already satisfied: future==0.18.2 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 12)) (0.18.2)
Requirement already satisfied: gunicorn==20.0.4 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 13)) (20.0.4)
Requirement already satisfied: itsdangerous==1.1.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 14)) (1.1.0)
Requirement already satisfied: jdcal==1.4.1 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 15)) (1.4.1)
Requirement already satisfied: Jinja2==2.11.3 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 16)) (2.11.3)
Requirement already satisfied: MarkupSafe==1.1.1 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 17)) (1.1.1)
Requirement already satisfied: numpy==1.20.1 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 18)) (1.20.1)
Requirement already satisfied: openpyxl==3.0.6 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 19)) (3.0.6)
Requirement already satisfied: pandas==1.2.3 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 20)) (1.2.3)
Requirement already satisfied: plotly==4.8.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 21)) (4.8.0)
Requirement already satisfied: python-dateutil==2.8.1 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 22)) (2.8.1)
Requirement already satisfied: pytz==2021.1 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 23)) (2021.1)
Requirement already satisfied: retrying==1.3.3 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 24)) (1.3.3)
Requirement already satisfied: six==1.15.0 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 25)) (1.15.0)
Requirement already satisfied: Werkzeug==1.0.1 in ./venv/lib/python3.8/site-packages (from -r requirements.txt (line 26)) (1.0.1)
Requirement already satisfied: setuptools>=3.0 in ./venv/lib/python3.8/site-packages/setuptools-40.8.0-py3.8.egg (from gunicorn==20.0.4->-r requirements.txt (line 13)) (40.8.0)
以下是推流后的全终端输入/输出:
(venv) (base) i@MacBook-Pro-I Heroku_test_project % git push heroku master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 323 bytes | 323.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Python app detected
remote: -----> Requirements file has been changed, clearing cached dependencies
remote: -----> Installing python-3.6.13
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 Brotli==1.0.9
remote: Downloading Brotli-1.0.9-cp36-cp36m-manylinux1_x86_64.whl (357 kB)
remote: Collecting click==7.1.2
remote: Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
remote: Collecting dash==1.19.0
remote: Downloading dash-1.19.0.tar.gz (75 kB)
remote: Collecting dash-core-components==1.15.0
remote: Downloading dash_core_components-1.15.0.tar.gz (3.5 MB)
remote: Collecting dash-html-components==1.1.2
remote: Downloading dash_html_components-1.1.2.tar.gz (188 kB)
remote: Collecting dash-pivottable==0.0.2
remote: Downloading dash_pivottable-0.0.2-py3-none-any.whl (5.9 MB)
remote: Collecting dash-renderer==1.9.0
remote: Downloading dash_renderer-1.9.0.tar.gz (1.0 MB)
remote: Collecting dash-table==4.11.2
remote: Downloading dash_table-4.11.2.tar.gz (1.8 MB)
remote: Collecting et-xmlfile==1.0.1
remote: Downloading et_xmlfile-1.0.1.tar.gz (8.4 kB)
remote: Collecting Flask==1.1.2
remote: Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)
remote: Collecting Flask-Compress==1.9.0
remote: Downloading Flask-Compress-1.9.0.tar.gz (10 kB)
remote: Collecting future==0.18.2
remote: Downloading future-0.18.2.tar.gz (829 kB)
remote: Collecting gunicorn==20.0.4
remote: Downloading gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
remote: Collecting itsdangerous==1.1.0
remote: Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
remote: Collecting jdcal==1.4.1
remote: Downloading jdcal-1.4.1-py2.py3-none-any.whl (9.5 kB)
remote: Collecting Jinja2==2.11.3
remote: Downloading Jinja2-2.11.3-py2.py3-none-any.whl (125 kB)
remote: Collecting MarkupSafe==1.1.1
remote: Downloading MarkupSafe-1.1.1-cp36-cp36m-manylinux2010_x86_64.whl (32 kB)
remote: ERROR: Could not find a version that satisfies the requirement numpy==1.20.1 (from -r /tmp/build_52cd8b55/requirements.txt (line 18)) (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0rc1, 1.17.0rc2, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0rc1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0rc1, 1.19.0rc2, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5)
remote: ERROR: No matching distribution found for numpy==1.20.1 (from -r /tmp/build_52cd8b55/requirements.txt (line 18))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 647088494036f734167427e0eeb869a73026b09c
remote: !
remote: ! We have detected that you have triggered a build from source code with version 647088494036f734167427e0eeb869a73026b09c
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to test_project.
remote:
To https://git.heroku.com/test_project.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/test_project.git'
发布于 2021-03-12 09:11:57
我只需要从requirements.txt中删除pandas和numpy行(就像我之前做的那样),但在提交之前,我必须运行
conda update -n base conda
conda update --all
推送语句起作用了,te app没有显示卸载pandas和numpy的错误。
https://stackoverflow.com/questions/66562928
复制