简体   繁体   中英

! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/stark-dawn-54447.git'

Im new to Django / Python and trying to deploy my first project to Heroku. Im getting the following error and have been following this guide to the letter: 'Django for beginners' by William S Vincent.

When I run: $git push heroku master

I get this:

error: : [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https.//git.heroku.com/stark-dawn-54447.git'

I've included all of the code returned below...

Many thanks

-----> Python app detected
-----> Installing python-3.8.5
-----> Installing pip 9.0.2, setuptools 47.1.1 and wheel 0.34.2
-----> Installing dependencies with Pipenv 2018.5.18…
       Traceback (most recent call last):
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/elements/abstracttable.py", line 27, in _enumerate_items
           yield next(non_metadata), next(non_metadata)
       StopIteration
       
       The above exception was the direct cause of the following exception:
       
       Traceback (most recent call last):
         File "/app/.heroku/python/lib/python3.8/site-packages/pipenv/project.py", line 438, in _parse_pipfile
           return contoml.loads(contents)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/contoml/__init__.py", line 15, in loads
           elements = parse_tokens(tokens)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/__init__.py", line 17, in parse_tokens
           return _parse_token_stream(TokenStream(tokens))
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/__init__.py", line 29, in _parse_token_stream
           elements, pending = toml_file_elements(token_stream)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/parser.py", line 375, in toml_file_elements
           captured = capture_from(token_stream).find(one).or_find(file_entry_element).or_empty()
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/recdesc.py", line 33, in find
           element, pending_ts = finder(self._token_stream)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/parser.py", line 372, in one
           c1 = capture_from(ts1).find(file_entry_element).and_find(toml_file_elements)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/recdesc.py", line 109, in and_find
           return Capturer(self.pending_tokens, self.value()).find(finder)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/recdesc.py", line 33, in find
           element, pending_ts = finder(self._token_stream)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/parser.py", line 375, in toml_file_elements
           captured = capture_from(token_stream).find(one).or_find(file_entry_element).or_empty()
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/recdesc.py", line 33, in find
           element, pending_ts = finder(self._token_stream)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/parser.py", line 372, in one
           c1 = capture_from(ts1).find(file_entry_element).and_find(toml_file_elements)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/recdesc.py", line 33, in find
           element, pending_ts = finder(self._token_stream)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/parser.py", line 364, in file_entry_element
           captured = capture_from(token_stream).find(table_header_element).\
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/recdesc.py", line 79, in or_find
           return Capturer(self._token_stream).find(finder)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/recdesc.py", line 33, in find
           element, pending_ts = finder(self._token_stream)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/parser/parser.py", line 350, in table_body_element
           return TableElement(captured.value()), captured.pending_tokens
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/elements/table.py", line 22, in __init__
           self._check_for_duplicate_keys()
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/elements/table.py", line 25, in _check_for_duplicate_keys
           if len(set(self.keys())) < len(self.keys()):
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/elements/abstracttable.py", line 37, in keys
           return tuple(key for (key, _) in self.items())
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/elements/abstracttable.py", line 37, in <genexpr>
           return tuple(key for (key, _) in self.items())
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/patched/prettytoml/elements/abstracttable.py", line 30, in items
           for (key_i, key), (value_i, value) in self._enumerate_items():
       RuntimeError: generator raised StopIteration
       
       During handling of the above exception, another exception occurred:
       
       Traceback (most recent call last):
         File "/app/.heroku/python/bin/pipenv", line 11, in <module>
           sys.exit(cli())
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
           return self.main(*args, **kwargs)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 697, in main
           rv = self.invoke(ctx)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
           return _process_result(sub_ctx.command.invoke(sub_ctx))
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
           return ctx.invoke(self.callback, **ctx.params)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
           return callback(*args, **kwargs)
         File "/app/.heroku/python/lib/python3.8/site-packages/pipenv/cli.py", line 385, in install
           do_install(
         File "/app/.heroku/python/lib/python3.8/site-packages/pipenv/core.py", line 1785, in do_install
           pre = project.settings.get('allow_prereleases')
         File "/app/.heroku/python/lib/python3.8/site-packages/pipenv/project.py", line 446, in settings
           return self.parsed_pipfile.get('pipenv', {})
         File "/app/.heroku/python/lib/python3.8/site-packages/pipenv/project.py", line 392, in parsed_pipfile
           parsed = self._parse_pipfile(contents)
         File "/app/.heroku/python/lib/python3.8/site-packages/pipenv/project.py", line 441, in _parse_pipfile
           return toml.loads(contents)
         File "/tmp/build_4d226441/.heroku/python/lib/python3.8/site-packages/pipenv/vendor/toml.py", line 342, in loads
           raise TomlDecodeError("What? " + group +
       toml.TomlDecodeError: What? requires already exists?{'source': [{'name': 'pypi', 'url': 'https://pypi.org/simple', 'verify_ssl': True}], 'dev-packages': {}, 'packages': {'django': '==3.0.1'}, 'requires': {'python_version': '3.8'}}
 !     Push rejected, failed to compile Python app.
 !     Push failed

Yeah that's something wrong with Pipenv, looks like its using a generator which is not being handled properly.

To resolve this, you can upgrade your Pipenv version from 2018.5.18 to the current version which is 2020.6.2 from PyPI .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM