0

thanks for your help.

It seems that when I attempt to git push heroku master, I get the following error:

remote: -----> Installing python-3.6.12
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting otree>=2.5.0
remote:          Downloading otree-3.0.6.tar.gz (847 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-mka_62qe/otree/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mka_62qe/otree/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-pip-egg-info-5rga_gck
remote:                 cwd: /tmp/pip-install-mka_62qe/otree/
remote:            Complete output (3 lines):
remote:
remote:            Error: This version of oTree requires Python 3.7 or higher.
remote:
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 projectivity-experiment.
remote:
To https://git.heroku.com/projectivity-experiment.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/projectivity-experiment.git' 

I am not sure what it is about Python since I have version 3.8.5 installed on the computer but it seems to be installing python-3.6.12 (which is lower than the indicated required python version for some reason)

  • Is this what you are looking for? [Here](https://stackoverflow.com/questions/28318599/git-push-error-pre-receive-hook-declined) – Abdulaziz Aug 27 '20 at 21:19
  • Hi, not really, but thanks. The more specific problem is how do I get the push to not load the heroku default python runtime (3.6.12), and to instead use 3.8.5. There seems to be something about a runtime.tex file but for some reason that doesn't work for me either. Thanks again! – Zydney Wong Aug 27 '20 at 21:57

1 Answers1

0

To fix the issue of Python version make a file called runtime.txt at the root with your Procfile.

python-3.8.3
Abdulaziz
  • 3,363
  • 1
  • 7
  • 24
  • That sounds vaguely familiar. What exactly is the Procfile though? (sorry I am a real novice here!) – Zydney Wong Aug 27 '20 at 22:03
  • It should be something like this where main.py is the bot file `worker: python main.py` – Abdulaziz Aug 27 '20 at 22:07
  • Right. As I have yet to start building an app, I assume this should be where the requirements,txt file is and where I had changed my directory too in the command prompt? Is it sufficient to make a .txt file in notepad and include the line python-3.8.5, or should I do it through a python editor? – Zydney Wong Aug 27 '20 at 22:11
  • Exactly you should have all of the three `requirements.txt`, `Procfile` and `runtime.txt`. You can use both to do it. – Abdulaziz Aug 27 '20 at 22:13
  • Am I wrong in saying that if I don't have a Procfile but I did make the runtime.txt file, it still will not be sufficient to fix the error? Edit: Oh it appears I do have a Procfile but it is empty – Zydney Wong Aug 27 '20 at 22:15
  • If you don't have a `Procfile` then you will have no worker which means it will not work simply. Above is what you have to add in that file. – Abdulaziz Aug 27 '20 at 22:26