oTree Forum >

can't upload old app onto heroku

#1 by ksaral

Tried to follow old instructions.  The version of otree that this app was programmed in is otree-core==0.5.2.  The error code I have when I do the git push thing is this:
 -----> Building on the Heroku-22 stack
-----> Determining which buildpack to use for this app
-----> Python app detected
-----> No Python version was specified. Using the buildpack default: python-3.11.5
       To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.11.5
-----> Installing pip 23.2.1, setuptools 68.0.0 and wheel 0.41.0
-----> Installing SQLite3
-----> Installing requirements with pip
       Collecting Django==1.8.8 (from -r requirements_base.txt (line 1))
         Downloading Django-1.8.8-py2.py3-none-any.whl (6.2 MB)
       Collecting otree-core==0.5.2 (from -r requirements_base.txt (line 2))
         Downloading otree-core-0.5.2.zip (1.4 MB)
         Preparing metadata (setup.py): started
         Preparing metadata (setup.py): finished with status 'done'
       Collecting psycopg2==2.5.1 (from -r requirements_heroku.txt (line 3))
         Downloading psycopg2-2.5.1.tar.gz (684 kB)
         Preparing metadata (setup.py): started
         Preparing metadata (setup.py): finished with status 'error'
         error: subprocess-exited-with-error
         
         × python setup.py egg_info did not run successfully.
         │ exit code: 1
         ╰─> [13 lines of output]
             /app/.heroku/python/lib/python3.11/site-packages/setuptools/command/sdist.py:117: SetuptoolsDeprecationWarning: `build_py` command does not inherit from setuptools' `build_py`.
             !!
             
                     ********************************************************************************
                     Custom 'build_py' does not implement 'get_data_files_without_manifest'.
                     Please extend command classes from setuptools instead of distutils.
             
                     See https://peps.python.org/pep-0632/ for details.
                     ********************************************************************************
             
             !!
               self._add_data_files(self._safe_data_files(build_py))
             Error: could not determine PostgreSQL version from '15.3'
             [end of output]
         
         note: This error originates from a subprocess, and is likely not a problem with pip.
       error: metadata-generation-failed
       
       × Encountered error while generating package metadata.
       ╰─> See above for output.
       
       note: This is an issue with the package mentioned above, not pip.
       hint: See above for details.
 !     Push rejected, failed to compile Python app.
 !     Push failed


This is driving me bonkers.  I just have to run this thing for a revision and I'm wasting too much time on trying to get this thing working.  Any graduate students want to make some extra cash and help me get this thing up?  Or is there an easy fix?  Thanks - Krista ksaral@uncc.edu

#2 by Daniel_Frey

Hi Krista

Are you running your experiment on a different Python version locally, and it works? Try to specify that version for Heroku.

Maybe the latest Python version (3.11.5) is incompatible with your code.

#3 by ksaral

Checked that - it runs locally on 3.11, but many thanks for the reply.

#4 by ksaral

Actually update - I wasn't running 3.11.5 - I was running 2.7.11.  So it runs locally with that and I can't upload into heroku with that version of python.  Anyone have a guess as to which version I may be able to run an app written in 2015 with?

#5 by Daniel_Frey

I'd suggest you add a runtime.txt file to your project (on the same level as requirements.txt) and write python-2.7.11 inside it to specify the same Python version to Heroku as you use to run it locally.

#6 by ksaral

Many thanks - tried that but it's blocked as well.  I think it will only go as low was 3.7.. 
https://devcenter.heroku.com/articles/python-support
Does anyone have experience running on their own server?  I'm asking at my uni to see if they can do it running python 2.7.11, but not that I know what I'm doing on that either :)

#7 by Daniel_Frey

That's out of my league as well, sorry...

Maybe it would be easier to try to update your oTree-code so that it runs on a later Python-version?

#8 by ErikdeKwaadsteniet

Yes I think heroku will not run python 2.7, but you can maybe get it to work on a local server if you build a virtual environment using python 2.7 and install the old otree version in that venv. That worked for me when trying to install otree 3 on a new linux distribution (see the other thread about installing otree 3 on ubuntu 22.04).

Write a reply

Set forum username