简体   繁体   中英

Push rejected, failed to compile python project - Django , Heroku

It is my first deployment, I am trying to push my django project into heroku but it is saying push rejected; failed to compile python project. i have tried changing the python lower versions but no luck. Any help would be much appreciated.! Thanks.

Here, is my cmd output

>     (blog-rHhqYg-f) C:\projects\blog>git push heroku master
>     Enumerating objects: 72, done.
>     Counting objects: 100% (72/72), done.
>     Delta compression using up to 4 threads
>     Compressing objects: 100% (67/67), done.
>     Writing objects: 100% (72/72), 22.87 KiB | 2.86 MiB/s, done.
>     Total 72 (delta 25), reused 0 (delta 0), pack-reused 0
>     remote: Compressing source files... done.
>     remote: Building source:
>     remote:
>     remote: -----> Building on the Heroku-20 stack
>     remote: -----> Determining which buildpack to use for this app
>     remote: -----> Python app detected
>     remote: -----> No Python version was specified. Using the buildpack default: pyt
>     hon-3.9.9
>     remote:        To use a different version, see: https://devcenter.heroku.com/art
>     icles/python-runtimes
>     remote: cp: cannot stat '/tmp/build_9e902a87/requirements.txt': No such file or
>     directory
>     remote: -----> Installing python-3.9.9
>     remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
>     remote: -----> Installing dependencies with Pipenv 2020.11.15
>     remote:        Traceback (most recent call last):
>     remote:          File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/pr
>     oject.py", line 573, in _parse_pipfile
>     remote:            return tomlkit.parse(contents)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/tomlkit/api.py", line 49, in parse
>     remote:            return Parser(string).parse()
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/tomlkit/parser.py", line 153, in parse
>     remote:            key, value = self._parse_table()
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/tomlkit/parser.py", line 1145, in _parse_table
>     remote:            item = self._parse_item()
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/tomlkit/parser.py", line 299, in _parse_item
>     remote:            return self._parse_key_value(True)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/tomlkit/parser.py", line 390, in _parse_key_value
>     remote:            val = self._parse_value()
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/tomlkit/parser.py", line 660, in _parse_value
>     remote:            raise self.parse_error(InvalidNumberError)
>     remote:        tomlkit.exceptions.InvalidNumberError: Invalid number at line 14
>     col 22
>     remote:
>     remote:        During handling of the above exception, another exception occurre
>     d:
>     remote:
>     remote:        Traceback (most recent call last):
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/toml/decoder.py", line 511, in loads
>     remote:            ret = decoder.load_line(line, currentlevel, multikey,
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/toml/decoder.py", line 778, in load_line
>     remote:            value, vtype = self.load_value(pair[1], strictly_valid)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/toml/decoder.py", line 912, in load_value
>     remote:            v = float(v)
>     remote:        ValueError: could not convert string to float: '3.6.8'
>     remote:
>     remote:        During handling of the above exception, another exception occurre
>     d:
>     remote:
>     remote:        Traceback (most recent call last):
>     remote:          File "/app/.heroku/python/bin/pipenv", line 8, in <module>
>     remote:            sys.exit(cli())
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/click/core.py", line 829, in __call__
>     remote:            return self.main(*args, **kwargs)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/click/core.py", line 782, in main
>     remote:            rv = self.invoke(ctx)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/click/core.py", line 1259, in invoke
>     remote:            return _process_result(sub_ctx.command.invoke(sub_ctx))
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/click/core.py", line 1066, in invoke
>     remote:            return ctx.invoke(self.callback, **ctx.params)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/click/core.py", line 610, in invoke
>     remote:            return callback(*args, **kwargs)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/click/decorators.py", line 73, in new_func
>     remote:            return ctx.invoke(f, obj, *args, **kwargs)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/click/core.py", line 610, in invoke
>     remote:            return callback(*args, **kwargs)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/click/decorators.py", line 21, in new_func
>     remote:            return f(get_current_context(), *args, **kwargs)
>     remote:          File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/cl
>     i/command.py", line 233, in install
>     remote:            retcode = do_install(
>     remote:          File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/co
>     re.py", line 1938, in do_install
>     remote:            pre = project.settings.get("allow_prereleases")
>     remote:          File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/pr
>     oject.py", line 607, in settings
>     remote:            return self.parsed_pipfile.get("pipenv", {})
>     remote:          File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/pr
>     oject.py", line 550, in parsed_pipfile
>     remote:            parsed = self._parse_pipfile(contents)
>     remote:          File "/app/.heroku/python/lib/python3.9/site-packages/pipenv/pr
>     oject.py", line 577, in _parse_pipfile
>     remote:            return toml.loads(contents)
>     remote:          File "/tmp/build_9e902a87/.heroku/python/lib/python3.9/site-pac
>     kages/pipenv/vendor/toml/decoder.py", line 514, in loads
>     remote:            raise TomlDecodeError(str(err), original, pos)
>     remote:        toml.decoder.TomlDecodeError: could not convert string to float:
>     '3.6.8' (line 14 column 1 char 173)
>     remote:  !     Push rejected, failed to compile Python app.
>     remote:
>     remote:  !     Push failed
>     remote: Verifying deploy...
>     remote:
>     remote: !       Push rejected to heha-blog.
>     remote:
>     To https://git.heroku.com/heha-blog.git
>      ! [remote rejected] master -> master (pre-receive hook declined)
>     error: failed to push some refs to 'https://git.heroku.com/heha-blog.git'

My Pipfile.py

[[source]] url = "https://pypi.org/simple" verify_ssl = true name = "pypi"

 [packages] django = "*" gunicorn = "==19.9.0" whitenoise = "==3.3.1" [dev-packages] [requires] python_version = 3.6.8 Django==1.4.3

My Pipfile.Lock

 { "_meta": { "hash": { "sha256": "fbd345aadc26e16ba5b75b8b8b07675c01938c5148d0b18172caf173ea382c4a" }, "pipfile-spec": 6, "requires": { "python_version": "3.6.8" }, "sources": [ { "name": "pypi", "url": "https://pypi.org/simple", "verify_ssl": true } ] }, "default": { "asgiref": { "hashes": [ "sha256:4ef1ab46b484e3c706329cedeff284a5d40824200638503f5768edb6de7d58e9", "sha256:ffc141aa908e6f175673e7b1b3b7af4fdb0ecb738fc5c8b88f69f055c2415214" ], "markers": "python_version >= '3.6'", "version": "==3.4.1" }, "backports.zoneinfo": { "hashes": [ "sha256:17746bd546106fa389c51dbea67c8b7c8f0d14b5526a579ca6ccf5ed72c526cf", "sha256:1b13e654a55cd45672cb54ed12148cd33628f672548f373963b0bff67b217328", "sha256:1c5742112073a563c81f786e77514969acb58649bcdf6cdf0b4ed31a348d4546", "sha256:4a0f800587060bf8880f954dbef70de6c11bbe59c673c3d818921f042f9954a6", "sha256:5c144945a7752ca544b4b78c8c41544cdfaf9786f25fe5ffb10e838e19a27570", "sha256:7b0a64cda4145548fed9efc10322770f929b944ce5cee6c0dfe0c87bf4c0c8c9", "sha256:8439c030a11780786a2002261569bdf362264f605dfa4d65090b64b05c9f79a7", "sha256:8961c0f32cd0336fb8e8ead11a1f8cd99ec07145ec2931122faaac1c8f7fd987", "sha256:89a48c0d158a3cc3f654da4c2de1ceba85263fafb861b98b59040a5086259722", "sha256:a76b38c52400b762e48131494ba26be363491ac4f9a04c1b7e92483d169f6582", "sha256:da6013fd84a690242c310d77ddb8441a559e9cb3d3d59ebac9aca1a57b2e18bc", "sha256:e55b384612d93be96506932a786bbcde5a2db7a9e6a4bb4bffe8b733f5b9036b", "sha256:e81b76cace8eda1fca50e345242ba977f9be6ae3945af8d46326d776b4cf78d1", "sha256:e8236383a20872c0cdf5a62b554b27538db7fa1bbec52429d8d106effbaeca08", "sha256:f04e857b59d9d1ccc39ce2da1021d196e47234873820cbeaad210724b1ee28ac", "sha256:fadbfe37f74051d024037f223b8e001611eac868b5c5b06144ef4d8b799862f2" ], "markers": "python_version < '3.9'", "version": "==0.2.1" }, "django": { "hashes": [ "sha256:59304646ebc6a77b9b6a59adc67d51ecb03c5e3d63ed1f14c909cdfda84e8010", "sha256:d5a8a14da819a8b9237ee4d8c78dfe056ff6e8a7511987be627192225113ee75" ], "index": "pypi", "version": "==1.4.3" }, "gunicorn": { "hashes": [ "sha256:aa8e0b40b4157b36a5df5e599f45c9c76d6af43845ba3b3b0efe2c70473c2471", "sha256:fa2662097c66f920f53f70621c6c58ca4a3c4d3434205e608e121b5b3b71f4f3" ], "index": "pypi", "version": "==19.9.0" }, "sqlparse": { "hashes": [ "sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae", "sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d" ], "markers": "python_version >= '3.5'", "version": "==0.4.2" }, "tzdata": { "hashes": [ "sha256:3eee491e22ebfe1e5cfcc97a4137cd70f092ce59144d81f8924a844de05ba8f5", "sha256:68dbe41afd01b867894bbdfd54fa03f468cfa4f0086bfb4adcd8de8f24f3ee21" ], "markers": "sys_platform == 'win32'", "version": "==2021.5" }, "whitenoise": { "hashes": [ "sha256:15f43b2e701821b95c9016cf469d29e2a546cb1c7dead584ba82c36f843995cf", "sha256:9d81515f2b5b27051910996e1e860b1332e354d9e7bcf30c98f21dcb6713e0dd" ], "index": "pypi", "version": "==3.3.1" } }, "develop": {} }

My. Procfile

web: gunicorn blog.wsgi --log-file -

The most probable cause for this error lies on your Pipfile.py. All values for dependencies and requirements should be strings, therefore wrapped into quotes, so the dependencies installer doesn't try to cast the version as a number.

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