部署Discord bot时Heroku部署错误

时间:2020-05-27 18:14:55

标签: python heroku discord

我试图将我的discord bot部署在heroku上,但是当我尝试进行第一次提交时,我一直遇到此错误。我的理论是require.txt文件中缺少某些内容,但是我不确定,因为我无法确定错误告诉了我什么。我不确定如何填写requirements.txt文件,但是我输入了整个程序中正在使用的每个库的名称,例如selenium,discord.py和dotenv。

    C:\Users\luked\PycharmProjects\invasionbot>git commit -am "first commit"
    On branch master
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            .idea/

    nothing added to commit but untracked files present (use "git add" to track)

    C:\Users\luked\PycharmProjects\invasionbot>git add .
    warning: LF will be replaced by CRLF in .idea/workspace.xml.
    The file will have its original line endings in your working directory

    C:\Users\luked\PycharmProjects\invasionbot>git push heroku master
    Enumerating objects: 14, done.
    Counting objects: 100% (14/14), done.
    Delta compression using up to 12 threads
    Compressing objects: 100% (12/12), done.
    Writing objects: 100% (14/14), 4.20 MiB | 1.03 MiB/s, done.
    Total 14 (delta 2), reused 0 (delta 0), pack-reused 0
    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 selenium
    remote:          Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB)
    remote:        Collecting discord
    remote:          Downloading discord-1.0.1-py3-none-any.whl (1.1 kB)
    remote:        Collecting dotenv
    remote:          Downloading dotenv-0.0.5.tar.gz (2.4 kB)
    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-install-s0g44jdw/dotenv/setup.py'"'"'; __file__='"'"'/tmp/pip-install-s0g44jdw/dotenv/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-install-s0g44jdw/dotenv/pip-egg-info
    remote:                 cwd: /tmp/pip-install-s0g44jdw/dotenv/
    remote:            Complete output (68 lines):
    remote:            Traceback (most recent call last):
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules
    remote:                yield saved
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/sandbox.py", line 194, in setup_context
    remote:                __import__('setuptools')
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/__init__.py", line 2, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/extension.py", line 5, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/dist.py", line 7, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/command/__init__.py", line 8, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/command/install_scripts.py", line 3, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/pkg_resources.py", line 1518, in <module>
    remote:            AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
    remote:
    remote:            During handling of the above exception, another exception occurred:
    remote:
    remote:            Traceback (most recent call last):
    remote:              File "<string>", line 1, in <module>
    remote:              File "/tmp/pip-install-s0g44jdw/dotenv/setup.py", line 23, in <module>
    remote:                scripts=['scripts/dotenv']
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/__init__.py", line 128, in setup
    remote:                _install_setup_requires(attrs)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
    remote:                dist.fetch_build_eggs(dist.setup_requires)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/dist.py", line 513, in fetch_build_eggs
    remote:                replace_conflicting=True,
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 774, in resolve
    remote:                replace_conflicting=replace_conflicting
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1057, in best_match
    remote:                return self.obtain(req, installer)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1069, in obtain
    remote:                return installer(requirement)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/dist.py", line 580, in fetch_build_egg
    remote:                return cmd.easy_install(req)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
    remote:                return self.install_item(spec, dist.location, tmpdir, deps)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 699, in install_item
    remote:                dists = self.install_eggs(spec, download, tmpdir)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 884, in install_eggs
    remote:                return self.build_and_install(setup_script, setup_base)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1152, in build_and_install
    remote:                self.run_setup(setup_script, setup_base, args)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1138, in run_setup
    remote:                run_setup(setup_script, args)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/sandbox.py", line 233, in run_setup
    remote:                with setup_context(setup_dir):
    remote:              File "/app/.heroku/python/lib/python3.6/contextlib.py", line 81, in __enter__
    remote:                return next(self.gen)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context
    remote:                yield
    remote:              File "/app/.heroku/python/lib/python3.6/contextlib.py", line 99, in __exit__
    remote:                self.gen.throw(type, value, traceback)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/sandbox.py", line 166, in save_modules
    remote:                saved_exc.resume()
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/sandbox.py", line 141, in resume
    remote:                six.reraise(type, exc, self._tb)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/_vendor/six.py", line 685, in reraise
    remote:                raise value.with_traceback(tb)
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules
    remote:                yield saved
    remote:              File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/sandbox.py", line 194, in setup_context
    remote:                __import__('setuptools')
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/__init__.py", line 2, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/extension.py", line 5, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/dist.py", line 7, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/command/__init__.py", line 8, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/setuptools/command/install_scripts.py", line 3, in <module>
    remote:              File "/tmp/easy_install-sj4nzrau/distribute-0.7.3/pkg_resources.py", line 1518, in <module>
    remote:            AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
    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 tooncogbot.
    remote:
    To https://git.heroku.com/tooncogbot.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/tooncogbot.git

'

0 个答案:

没有答案