Problems with otree 3.x on Heroku because of incompatibility with Python 3.9

585 views
Skip to first unread message

Gustav Karreskog

unread,
Oct 4, 2021, 3:44:43 AM10/4/21
to oTree help & discussion
Hi everyone!

I am currently running an experiment which I originally wrote in otree 3, and therefore have kept in the old format since it is so far has been working well. However, today after I tried to deploy a very minor bugfix via otreehub, I got the following message:

-----> Building on the Heroku-18 stack
-----> Using buildpack: heroku/python
-----> Python app detected
-----> Using Python version specified in runtime.txt
 !     Python has released a security update! Please consider upgrading to python-3.9.7
       Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Requirements file has been changed, clearing cached dependencies
-----> Installing python-3.9.2
-----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
-----> Installing SQLite3
-----> Installing requirements with pip
       Collecting otree<3.9
         Downloading otree-3.4.0.tar.gz (321 kB)
           ERROR: Command errored out with exit status 1:
            command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_w0gxgqk/otree/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_w0gxgqk/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-7qtiveog
                cwd: /tmp/pip-install-_w0gxgqk/otree/
           Complete output (1 lines):
           This version of oTree is not compatible with Python 3.9.
           ----------------------------------------
       ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
 !     Push rejected, failed to compile Python app.

 !     Push failed


I have tride to specify python-3.8.12 or python-3.7.12 in a file runtime.txt, but it seems like the otree zip command deletes that file when I run it. I completely understand that it is not a priority to include python 3.9 support for older otree versions, but would greatly appreciate any help with how to specify an older compatible python version on heroku.

/Gustav

Chris @ oTree

unread,
Oct 4, 2021, 5:27:23 AM10/4/21
to Gustav Karreskog, oTree help & discussion
What version of oTree do you have installed locally ?

Sent from my phone

On Oct 4, 2021, at 12:44 AM, Gustav Karreskog <gustav.k...@gmail.com> wrote:

Hi everyone!
--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/04797f0f-3b48-4399-9e01-03010cfc508fn%40googlegroups.com.

Gustav Karreskog

unread,
Oct 4, 2021, 5:44:15 AM10/4/21
to oTree help & discussion
I have otree<3.9 in my requirements.txt. But it looks like the one installed locally in my virtual environment was 5.4, which is strange since it worked perfectly fine when i ran it locally with devserver and I can't remember upgrading it. Anyhow, when I downgraded it locally and then ran otree zip I could suddenly deploy it again.

Thank you so much for you help and for developing this fantastic tool!  
Reply all
Reply to author
Forward
0 new messages