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

use*_*779 8 python django heroku

我正在尝试将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.
Run Code Online (Sandbox Code Playgroud)

好像它与Anaconda有关,但我在我的requirements.txt中很早就看到了Anaconda,所以认为它可能只是因为其他原因而被赶上的第一件事.任何帮助将不胜感激.谢谢.

Tms*_*s91 10

对于每条消息

找不到 X 的匹配分布

你得到的,你必须手动执行:

1 - 在requirements.txt X 出现的那一行,删除==<version number>
2 - 保存文件
3 - 提交
4 - 推送

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

注意:如果您的 X 是psycopg2,请将其替换为psycopg2-binary

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


小智 5

您在conda中创建了环境吗?

如果是这样,则在激活环境后。您需要conda install pip来激活pip安装,否则冻结pip将返回到默认的anaconda环境。(这就是为什么您在那里看到它们的原因)

  1. conda install pip
  2. pip再次安装所有可用的软件包。(例如pip install django
  3. pip freeze > requirements.txt

请参见下面的神话5 https://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/


Dan*_*man 1

根据PyPI 的说法,没有 anaconda-client 版本 1.4.0 这样的东西:最高版本是 1.2.2。