首页 > 解决方案 > 将机器人部署到heroku,无法将机器人推送到heroku

问题描述

我在将我使用 discord.py 制作的机器人部署到使用 heroku 的 discord 中时遇到问题。我遵循了许多指南,并研究了其他来源以及为什么会发生这种情况,但似乎没有任何效果。这就是我得到的......

remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.10
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting git+https://github.com/tony1bally/education-helper (from -r /tmp/build_e8b937d57bb9efdeafd512bb63149ee1/requirements.txt (line 1))
remote:          Cloning https://github.com/tony1bally/education-helper to /tmp/pip-req-build-7hfbm1vc
remote:          Running command git clone -q https://github.com/tony1bally/education-helper /tmp/pip-req-build-7hfbm1vc
remote:            ERROR: Command errored out with exit status 1:
remote:             command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-7hfbm1vc/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-7hfbm1vc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-7hfbm1vc/pip-egg-info
remote:                 cwd: /tmp/pip-req-build-7hfbm1vc/
remote:            Complete output (5 lines):
remote:            Traceback (most recent call last):
remote:              File "<string>", line 1, in <module>
remote:              File "/app/.heroku/python/lib/python3.6/tokenize.py", line 452, in open
remote:                buffer = _builtin_open(filename, 'rb')
remote:            FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-7hfbm1vc/setup.py'
remote:            ----------------------------------------
remote:        ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to education-helper.
remote:
To https://git.heroku.com/education-helper.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/education-helper.git'

有谁知道为什么会这样?这是通过命令提示符顺便说一句!

标签: pythongitheroku

解决方案


您已将https://github.com/tony1bally/education-helper声明为依赖项,requirements.txt但存储库为空,无法pip作为 Python 模块安装。

将其从中删除requirements.txt、添加、提交并再次推送。


推荐阅读