Fail to deploy flask app in Heroku with syntax error in setup.py

Viewed 42

I tried to push flask app to heroku for deployment, below is the error:

C:\Mentor_Engine>git push heroku master --force
Enumerating objects: 7333, done.
Counting objects: 100% (7333/7333), done.
Delta compression using up to 8 threads
Compressing objects: 100% (6790/6790), done.
Writing objects: 100% (7333/7333), 39.72 MiB | 2.25 MiB/s, done.
Total 7333 (delta 530), reused 7257 (delta 490), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-22 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the buildpack default: python-3.10.7
remote:        To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.10.7
remote: -----> Installing pip 22.2.2, setuptools 63.4.3 and wheel 0.37.1
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting certifi==2022.6.15
remote:          Downloading certifi-2022.6.15-py3-none-any.whl (160 kB)
remote:        Collecting chardet==5.0.0
remote:          Downloading chardet-5.0.0-py3-none-any.whl (193 kB)
remote:        Collecting charset-normalizer==2.1.1
remote:          Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
remote:        Collecting click==8.1.3
remote:          Downloading click-8.1.3-py3-none-any.whl (96 kB)
remote:        Collecting colorama==0.4.5
remote:          Downloading colorama-0.4.5-py2.py3-none-any.whl (16 kB)
remote:        Collecting dominate==2.7.0
remote:          Downloading dominate-2.7.0-py2.py3-none-any.whl (29 kB)
remote:        Collecting et-xmlfile==1.1.0
remote:          Downloading et_xmlfile-1.1.0-py3-none-any.whl (4.7 kB)
remote:        Collecting Flask==2.2.2
remote:          Downloading Flask-2.2.2-py3-none-any.whl (101 kB)
remote:        Collecting Flask-Bootstrap==3.3.7.1
remote:          Downloading Flask-Bootstrap-3.3.7.1.tar.gz (456 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting Flask-Dropzone==1.6.0
remote:          Downloading Flask_Dropzone-1.6.0-py2.py3-none-any.whl (23 kB)
remote:        Collecting Flask-WTF==1.0.1
remote:          Downloading Flask_WTF-1.0.1-py3-none-any.whl (12 kB)
remote:        Collecting hanging-threads==2.0.5
remote:          Downloading hanging_threads-2.0.5.tar.gz (4.0 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting idna==3.3
remote:          Downloading idna-3.3-py3-none-any.whl (61 kB)
remote:        Collecting itsdangerous==2.1.2
remote:          Downloading itsdangerous-2.1.2-py3-none-any.whl (15 kB)
remote:        Collecting Jinja2==3.1.2
remote:          Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
remote:        Collecting lml==0.1.0
remote:          Downloading lml-0.1.0-py2.py3-none-any.whl (10 kB)
remote:        Collecting MarkupSafe==2.1.1
remote:          Downloading MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
remote:        Collecting numpy==1.23.2
remote:          Downloading numpy-1.23.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.0 MB)
remote:        Collecting openpyxl==3.0.10
remote:          Downloading openpyxl-3.0.10-py2.py3-none-any.whl (242 kB)
remote:        Collecting pandas==1.4.3
remote:          Downloading pandas-1.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB)
remote:        Collecting plyer==2.0.0
remote:          Downloading plyer-2.0.0-py2.py3-none-any.whl (131 kB)
remote:        Collecting pyexcel==0.7.0
remote:          Downloading pyexcel-0.7.0-py2.py3-none-any.whl (87 kB)
remote:        Collecting pyexcel-io==0.6.6
remote:          Downloading pyexcel_io-0.6.6-py2.py3-none-any.whl (44 kB)
remote:        Collecting python-dateutil==2.8.2
remote:          Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
remote:        Collecting pytz==2022.2.1
remote:          Downloading pytz-2022.2.1-py2.py3-none-any.whl (500 kB)
remote:        Collecting requests==2.28.1
remote:          Downloading requests-2.28.1-py3-none-any.whl (62 kB)
remote:        Collecting six==1.16.0
remote:          Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
remote:        Collecting texttable==1.6.4
remote:          Downloading texttable-1.6.4-py2.py3-none-any.whl (10 kB)
remote:        Collecting urllib3==1.26.12
remote:          Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
remote:        Collecting visitor==0.1.3
remote:          Downloading visitor-0.1.3.tar.gz (3.3 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting Werkzeug==2.2.2
remote:          Downloading Werkzeug-2.2.2-py3-none-any.whl (232 kB)
remote:        Collecting win10toast==0.9
remote:          Downloading win10toast-0.9-py2.py3-none-any.whl (21 kB)
remote:        Collecting WTForms==3.0.1
remote:          Downloading WTForms-3.0.1-py3-none-any.whl (136 kB)
remote:        Collecting pypiwin32
remote:          Downloading pypiwin32-223-py3-none-any.whl (1.7 kB)
remote:          Downloading pypiwin32-219.zip (4.8 MB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'error'
remote:          error: subprocess-exited-with-error
remote:
remote:          × python setup.py egg_info did not run successfully.
remote:          │ exit code: 1
remote:          ╰─> [7 lines of output]
remote:              Traceback (most recent call last):
remote:                File "<string>", line 2, in <module>
remote:                File "<pip-setuptools-caller>", line 34, in <module>
remote:                File "/tmp/pip-install-qelhmrhd/pypiwin32_39527b7eee7344a3a6128393f0ae3b53/setup.py", line 121
remote:                  print "Building pywin32", pywin32_version
remote:                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
remote:              SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
remote:              [end of output]
remote:
remote:          note: This error originates from a subprocess, and is likely not a problem with pip.
remote:        error: metadata-generation-failed
remote:
remote:        × Encountered error while generating package metadata.
remote:        ╰─> See above for output.
remote:
remote:        note: This is an issue with the package mentioned above, not pip.
remote:        hint: See above for details.
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 166052c0301d19c92b6dd5b4f587a25941ed5f78
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 166052c0301d19c92b6dd5b4f587a25941ed5f78
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy....
remote:
remote: !       Push rejected to mentor-allocation-engine.
remote:
To https://git.heroku.com/mentor-allocation-engine.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/mentor-allocation-engine.git'

I not sure where should I locate the file "File "/tmp/pip-install-qelhmrhd/pypiwin32_39527b7eee7344a3a6128393f0ae3b53/setup.py", line 121" Anyone can help to solve this error? I have "git add . " and "git commit", error when push. I dont have Procfile and database, must I have one?

0 Answers
Related