- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 Flask 应用程序在本地运行。
当我通过 git push heroku master
将其推送到 Heroku 时,出现以下错误:
ERROR: Could not find a version that satisfies the requirement numpy==1.20.0 (from -r /tmp/build_b6c59d74/requirements.txt (line 12))
我认为这是因为我本地的 python 版本与 Heroku 的版本不匹配。
当我运行 python -V
时,我得到了 Python 3.7.4
。
根据下面的完整日志,Heroku 使用当前默认的 python-3.6.12
。
根据 this article , 我在我的根目录中添加了一个 runtime.txt
文件(与我的 requirements.txt
文件相同的目录)。
我最初添加了 python-3.7.4
,但是在检查了 Heroku 的 supported runtimes 之后,看来我应该使用 python-3.7.9
。
我已经将它更新为 python-3.7.9
。
当我运行 cat runtime.txt
时,我得到 python-3.7.9
。
我检查过没有换行符和空格,并且我使用的破折号是正确的。
但是当我运行 git push Heroku master
时,它似乎忽略了 runtime.txt
并安装了 python-3.6.12
(参见完整日志如下)。
我检查过我正在运行 supported stack ,当我运行 heroku stack
时,它显示 heroku-20
。
heroku buildpacks
返回 `heroku/python/。
下面是我运行 git push heroku master
时返回错误的完整日志
Total 0 (delta 0), reused 0 (delta 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.12
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 alembic==1.5.3
remote: Downloading alembic-1.5.3.tar.gz (1.1 MB)
remote: Collecting click==7.1.2
remote: Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
remote: Collecting Flask==1.1.2
remote: Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)
remote: Collecting Flask-Migrate==2.6.0
remote: Downloading Flask_Migrate-2.6.0-py2.py3-none-any.whl (13 kB)
remote: Collecting Flask-SQLAlchemy==2.4.4
remote: Downloading Flask_SQLAlchemy-2.4.4-py2.py3-none-any.whl (17 kB)
remote: Collecting Flask-WTF==0.14.3
remote: Downloading Flask_WTF-0.14.3-py2.py3-none-any.whl (13 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 Jinja2==2.11.2
remote: Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
remote: Collecting Mako==1.1.4
remote: Downloading Mako-1.1.4.tar.gz (479 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.0 (from -r /tmp/build_b6c59d74/requirements.txt (line 12)) (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.0b3, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.11.1rc1, 1.11.1, 1.11.2rc1, 1.11.2, 1.11.3, 1.12.0b1, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.1rc1, 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.0 (from -r /tmp/build_b6c59d74/requirements.txt (line 12))
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: dd64a89ce1402daf7c7b0804558f3f6ec776d188
remote: !
remote: ! We have detected that you have triggered a build from source code with version dd64a89ce1402daf7c7b0804558f3f6ec776d188
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 pure-lowlands-59273.
remote:
To https://git.heroku.com/pure-lowlands-59273.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pure-lowlands-59273.git'
请注意,我认为上面的警告是无关的,而是因为我多次尝试推送到 Heroku。
我检查了https://devcenter.heroku.com/articles/duplicate-build-version这似乎不是问题。所有本地更改均已提交且分支正确(均在 master
分支上)。
这个看似简单的过程真的让我怀疑自己的理智。
我在网上找不到以上报告类似错误的人,所以我假设这是某种打字错误?
我检查了 17 次 runtime.txt
的拼写及其文件内容是否有额外的空格或换行符。没有骰子。
我希望得到一些帮助。非常感谢您的帮助!
最佳答案
所以我想出了问题所在。
在我的 requirements.txt
文件中更新 numpy==1.19.5
后,尝试下载 numpy==1.20 时返回相同的错误.0
此时,Mihai’s评论看起来很有可能——这是一个提交问题。
我重读了https://devcenter.heroku.com/articles/duplicate-build-version并注意到以下通知:
Following changes in the industry, Heroku has updated our default git branch name to main. If the project you’re deploying uses master as its default branch name, use git push heroku master.
我注意到我在笔记中使用 git push heroku master
作为将更改部署到 Heroku 的方式。所以也许在此过程中的某个地方,我用 git 做了一些时髦的事情并推到了错误的分支。
我找到了这篇文章 https://devcenter.heroku.com/articles/git-branches关于从 Master -> Main 迁移。
所以我跑了:
git checkout master
git checkout -b main
git push heroku main
Bang... 直接进入 python-3.7.9
。
谢谢大家的帮助!
我希望这个解释能阻止其他人在未来犯同样的错误:)
关于python - Heroku 忽略 runtime.txt 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65986913/
我知道我要求太多,但也许你也可以帮助解决这个问题。 a.txt 包含单词,b.txt 包含字符串。 我想知道 b.txt 中有多少个字符串以 a.txt 中的单词结尾 例子:一个.txt apple
这个问题在这里已经有了答案: erge text files ordered by numerical filenames in Bash (3 个答案) 关闭 4 年前。 我有一个文件夹,其中包含
我在一个目录中有几个平面文件 (.txt)。所有这些文件的格式都是 *.txt.txt,所以我想将其重命名为 *.txt?有什么简单的方法可以一起重命名? 当我尝试 ren *.txt.txt *.t
这个问题在这里已经有了答案: How can I use a file in a command and redirect output to the same file without trunc
您是否有任何理由应该或不应该允许访问 javascript 或 css 文件?特别是常见的文件,如 jquery。 最佳答案 人们普遍认为,搜索引擎每天为给定站点分配一定数量的带宽或 URL。因此,一
Closed. This question is off-topic。它当前不接受答案。 想要改善这个问题吗? Update the question,所以它是用于堆栈溢出的on-topic。 已关闭
这是相同的代码。我面临的问题是,我无法在任何文件上写入任何内容。请帮忙解决这个问题 #include #include int main() { FILE *fe; FILE *fo;
我想要特定于域的 robots.txt,到目前为止这有效: RewriteRule ^robots\.txt$ robots/%{HTTP_HOST}.txt [L] 但我希望有一个后备方案,因此如果
我正在调试一些构建成功运行的 SQL 命令的代码。 然而,在查询结束时,查询结果似乎被写入了一个文本文件。 完整的查询如下 echo SELECT DATE,DATETABLE,DATE,APPDAT
这个问题已经有答案了: difference between grep Vs cat and grep (5 个回答) 已关闭 8 年前。 我看到一个例子,其中有人这样做: cat source.tx
我想将表中的数据从以 csv 格式存储的文本文件插入到 sql server 表中。为此,我正在使用批量插入语句。现在我需要在“From”子句中指定文件名。我不想在那里使用网络位置或本地位置。我想将我
假设我有一个测试文件夹 (test.domain.com) 并且我不希望搜索引擎在其中抓取,我是否需要在测试文件夹中有一个 robots.txt 或者我可以只放置一个 robots.txt在根目录中,
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 9年前关闭。 Improve this q
这个问题在这里已经有了答案: order of directives in robots.txt, do they overwrite each other or complement each ot
关闭。这个问题是opinion-based .它目前不接受答案。 想改进这个问题?更新问题,以便 editing this post 可以用事实和引用来回答它. 8年前关闭。 Improve this
已关闭。这个问题是 not about programming or software development 。目前不接受答案。 这个问题似乎不是关于 a specific programming
在过去的几年中,当我引用“名字”字段的文本框控件时,我一直使用 FirstNameTxt 命名约定。但是,我注意到大多数其他开发人员倾向于使用命名约定 txtFirstName 哪个是最好的约定?为什
我只想允许目录 /minsc 中的一个文件,但我想禁止该目录的其余部分。 现在 robots.txt 中是这样的: User-agent: * Crawl-delay: 10 # Directorie
我正在编写一个将 youtube.com 映射到另一个域的代理服务器(因此用户可以轻松地从德国等国家/地区访问 youtube,而无需审查搜索结果和视频)。 不幸的是,我的 robots.txt 中存
我没有编程技能,但有一项非常具体的任务:我必须将一个庞大的文本文件拆分成多个,并在特定的文本标记 (@) 处拆分它们。我决定尝试使用 Powershell 脚本来完成此任务。 到目前为止,这就是我想出
我是一名优秀的程序员,十分优秀!