AttributeError: viewonly

325 views
Skip to first unread message

Zheng Li

unread,
May 27, 2021, 4:16:18 AM5/27/21
to oTree help & discussion
I encountered the following error message when trying "otree devserver". This never happened, and I'm not sure what exactly I did to cause it.

======= ======= ======= =======
Traceback (most recent call last):
  File "C:\Program Files\Python39\Scripts\otree-script.py", line 33, in <module>
    sys.exit(load_entry_point('otree==5.1.10', 'console_scripts', 'otree')())
  File "c:\program files\python39\lib\site-packages\otree\main.py", line 106, in execute_from_command_line
    setup()
  File "c:\program files\python39\lib\site-packages\otree\main.py", line 140, in setup
    init_orm()
  File "c:\program files\python39\lib\site-packages\otree\database.py", line 307, in init_orm
    configure_mappers()
  File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\mapper.py", line 3299, in configure_mappers
    mapper._post_configure_properties()
  File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\mapper.py", line 1965, in _post_configure_properties
    prop.init()
  File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\interfaces.py", line 197, in init
    self.do_init()
  File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\relationships.py", line 2081, in do_init
    self._generate_backref()
  File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\relationships.py", line 2395, in _generate_backref
    self._add_reverse_property(self.back_populates)
  File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\relationships.py", line 2011, in _add_reverse_property
    self._check_sync_backref(other, self)
  File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\relationships.py", line 1988, in _check_sync_backref
    if rel_a.viewonly and rel_b.sync_backref:
  File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\util\langhelpers.py", line 987, in __getattr__
    return self._fallback_getattr(key)
  File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\util\langhelpers.py", line 961, in _fallback_getattr
    raise AttributeError(key)
AttributeError: viewonly
======= ======= ======= =======

Zheng Li

unread,
May 27, 2021, 4:18:44 AM5/27/21
to oTree help & discussion
Is this because library " sqlalchemy"? I recall that I recently changed the version of  sqlalchemy...

Chris @ oTree

unread,
May 27, 2021, 9:50:01 AM5/27/21
to Zheng Li, oTree help & discussion
It could be sqlalchemy. You should use the same version of sqlalchemy that otree installs automatically. 

Sent from my phone

On May 27, 2021, at 2:18 AM, Zheng Li <axia...@gmail.com> wrote:

Is this because library " sqlalchemy"? I recall that I recently changed the version of  sqlalchemy...
--
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/c6871bc7-6231-4047-9d59-0ad187660838n%40googlegroups.com.

Zheng Li

unread,
May 27, 2021, 9:59:05 AM5/27/21
to oTree help & discussion
Thanks Chris! Weird enough, another otree project of mine works just fine... I really wonder what was causing this - I haven't figured out a way to fix this. 

What is the default sqlalchemy version for otree?

Chris @ oTree

unread,
May 27, 2021, 11:54:10 AM5/27/21
to oTree help & discussion
Try reinstalling oTree and it should straighten things out.
Reply all
Reply to author
Forward
0 new messages