Heroku Upload - 找不到满足要求的版本 anaconda-client==1.4.0

新手上路,请多包涵

我正在尝试将 Django 应用程序推送到 Heroku,但在运行时出现以下错误 git push heroku master

 Counting objects: 80, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (74/74), done.
Writing objects: 100% (80/80), 990.21 KiB | 0 bytes/s, done.
Total 80 (delta 20), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote:  !     The latest version of Python 2 is python-2.7.14 (you are using
python-2.7.12, which is unsupported).
remote:  !     We recommend upgrading by specifying the latest version
(python-2.7.14).
remote:        Learn More: https://devcenter.heroku.com/articles/python-
runtimes
remote: -----> Installing python-2.7.12
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote:        Collecting alabaster==0.7.7 (from -r
/tmp/build_a1f6d188f9e0e61e01076a73d4e10542/requirements.txt (line 1))
remote:          Downloading alabaster-0.7.7-py2.py3-none-any.whl
remote:        Collecting anaconda-client==1.4.0 (from -r
/tmp/build_a1f6d188f9e0e61e01076a73d4e10542/requirements.txt (line 2))
remote:          Could not find a version that satisfies the requirement
anaconda-client==1.4.0 (from -r
/tmp/build_a1f6d188f9e0e61e01076a73d4e10542/requirements.txt (line 2)) (from
versions: 1.1.1, 1.2.2)
remote:        No matching distribution found for anaconda-client==1.4.0 (from
-r /tmp/build_a1f6d188f9e0e61e01076a73d4e10542/requirements.txt (line 2))
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !   Push rejected to demo-freshstart.

似乎它与 Anaconda 有关,但我很早就在我的 requirements.txt 中看到了 Anaconda,所以认为它可能只是因为其他原因而被赶上的第一件事。

原文由 user3294779 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 370
1 个回答

对于每条消息

找不到 X 的匹配分布

你得到的,你必须手动做:

1 - 在 requirements.txt 行,其中 X 出现,删除 ==<version number>

2 - 保存文件

3 - 提交

4 - 推

对提示报告的下一个错误再次执行此操作,直到到达 requirements.txt 中包含的列表的末尾。

(如果您的 X 是 psycopg2 ,请将其替换为 psycopg2-binary )。


通过安装和运行 pip-chill 可以获得相同的结果

pip install pip_chill
pip-chill --no-version > requirements.txt

注意: 这是最后的资源解决方案,因此,在实施之前,请按照 此答案 的说明查看是否可以解决问题

原文由 Tms91 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题