【问题标题】:Outdated Pipfile.lock过时的 Pipfile.lock
【发布时间】:2018-09-03 09:58:51
【问题描述】:

我正在尝试将一个大型 django 项目部署到 heroku。我安装了 Heroku CLI,登录,创建了一个应用程序并运行:

git push heroku master

我已经设置了 Pipfile 和 requirements.txt。我添加了一个 runtime.txt 来指定我需要 python 2.7。这也在 Pipfile 中。这就是我从推送到 heroku 得到的:

Counting objects: 12159, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4853/4853), done.
Writing objects: 100% (12159/12159), 20.94 MiB | 1.82 MiB/s, done.
Total 12159 (delta 6859), reused 12036 (delta 6751)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing python-3.6.4
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 11.8.2…
remote:        Your Pipfile.lock (3b2ba9) is out of date. Expected: (83a5b4).
remote:        Aborting deploy.
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy....
remote: 
remote: !   Push rejected to camp-infinity.
remote: 
To https://git.heroku.com/camp-infinity.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/camp-infinity.git'

我不确定它为什么要安装 python 3,而且它也不喜欢我的 Pipfile.lock 文件。我尝试删除它并使用 pipenv install 再次生成它,但这并没有改变任何东西。

【问题讨论】:

标签: django heroku


【解决方案1】:

确保您已在 Python 2.X 中使用 pipenv --two 初始化您的环境,然后 - 假设您的代码在本地运行并且所有依赖项都在您的 Pipfile 中指定 - 运行 pipenv install 并提交所有更改,包括 Pipfile.lock 到您本地的 git 存储库 (git add * && git commit -m "your message")。最后推到heroku。希望它现在可以正确构建。

【讨论】:

    猜你喜欢
    • 2018-09-02
    • 2018-11-24
    • 2019-10-24
    • 1970-01-01
    • 2018-03-02
    • 1970-01-01
    • 2019-03-27
    • 1970-01-01
    • 2018-05-26
    相关资源
    最近更新 更多