有没有人见过这个?下面是我自从添加新的依赖项pysendy后尝试推送到heroku时出现的输出日志。
请注意,pysendy需要模块“请求”,因此我还向requests.txt添加了请求。如果仔细查看日志顶部,您会看到请求模块已下载&在dyno启动期间解压缩,但pysendy没有看到它。我甚至尝试将'requests'放在requirements.txt的顶部,没有任何改变。 Heroku拒绝该应用程序。我可以通过手动将pysendy导入到我的项目中来解决这个问题,因为它很小,但是那种方式会让人产生依赖性。
我怀疑当pysendy尝试访问请求模块时,有关请求模块依赖项安装的内容未完成。
requests==2.2.1
Django==1.6.2
dj-database-url==0.3.0
dj-static==0.0.5
django-toolbelt==0.0.1
djangorestframework==2.3.13
gunicorn==18.0
psycopg2==2.5.2
pysendy==0.0.3
pystache==0.5.3
static==1.0.2
-----> Python app detected
-----> Using Python runtime (python-3.4.0)
-----> Installing dependencies using Pip (1.5.4)
Downloading/unpacking requests==2.2.1 (from -r requirements.txt (line 1))
Downloading/unpacking pysendy==0.0.3 (from -r requirements.txt (line 11))
Downloading pysendy-0.0.3.tar.gz
Running setup.py (path:/tmp/pip_build_u37993/pysendy/setup.py) egg_info for package pysendy
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_u37993/pysendy/setup.py", line 5, in <module>
version = __import__('pysendy').__version__
File "/tmp/pip_build_u37993/pysendy/pysendy/__init__.py", line 2, in <module>
from .pysendy import *
File "/tmp/pip_build_u37993/pysendy/pysendy/pysendy.py", line 3, in <module>
import requests
ImportError: No module named 'requests'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_u37993/pysendy/setup.py", line 5, in <module>
version = __import__('pysendy').__version__
File "/tmp/pip_build_u37993/pysendy/pysendy/__init__.py", line 2, in <module>
from .pysendy import *
File "/tmp/pip_build_u37993/pysendy/pysendy/pysendy.py", line 3, in <module>
import requests
ImportError: No module named 'requests'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_u37993/pysendy
Storing debug log for failure in /app/.pip/pip.log
! Push rejected, failed to compile Python app
答案 0 :(得分:1)
似乎pysendy
在安装过程中尝试使用requests
,尽管它的安装要求(请参阅https://github.com/thiagofa/pysendy/blob/master/setup.py)仍然没有安装。这显然是一个上游错误,因为它在一个干净的虚拟环境上重现。
解决方法可能是将requirements.txt
与pysendy
注释掉,让它完成,从而完全安装requests
,然后再将完整版推送到Heroku。