Issue with download_datafiles and launching psiturk

57 views
Skip to first unread message

Buddhika Bellana

unread,
Jan 4, 2022, 8:59:26 AM1/4/22
to PsiTurk
Hello! I have an experiment set up on Heroku, following the steps on the Psiturk docs.

When I run download_datafiles, I get CSVs that are based on the default Stroop demo rather than my own experiment. DATABASE_URL (via heroku config) is defined as the correct postgres database though...

Next, I tried changing my config.txt file to define the postgres database_url there, in the Database Parameter section. Now, psiturk  won't launch at all. I get the following error:

(glendon_psiturk3) pbs-jc-lap4:SMWSCTH_prolific_psiturk3_neutralcue bbellan1$ psiturk
Traceback (most recent call last):
  File "/miniconda3/envs/glendon_psiturk3/bin/psiturk", line 8, in <module>
    sys.exit(process())
  File "/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psiturk/command_line.py", line 14, in process
    launch_shell()
  File "/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psiturk/command_line.py", line 94, in launch_shell
    import psiturk.psiturk_shell as ps
  File "/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psiturk/psiturk_shell.py", line 12, in <module>
    from psiturk.models import Participant
  File "/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psiturk/models.py", line 9, in <module>
    from psiturk.db import db_session
  File "/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psiturk/db.py", line 24, in <module>
    engine = create_engine(DATABASE, echo=False, pool_recycle=3600)
  File "/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/sqlalchemy/engine/__init__.py", line 525, in create_engine
    return strategy.create(*args, **kwargs)
  File "/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 87, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 792, in dbapi
    import psycopg2
  File "/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psycopg2/__init__.py", line 51, in <module>
    from psycopg2._psycopg import (                     # noqa
ImportError: dlopen(/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so, 2): Symbol not found: ____chkstk_darwin
  Referenced from: /miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psycopg2/.dylibs/libcrypto.1.1.dylib (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib
 in /miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psycopg2/.dylibs/libcrypto.1.1.dylib


I'm not sure how to make sense of this output. I get the same issue when I define DATABASE_URL in a .env file in my root psiturk directory. Maybe the ImportError line I bolded might be informative?

Any advice would be appreciated!

Buddhika

Specs:
Mac OS 10.13.6
Psiturk 3.2.1
Wasn't having these problems a few months back (~Oct 2021)



Dave Eargle

unread,
Jan 4, 2022, 12:20:15 PM1/4/22
to Buddhika Bellana, PsiTurk
Try `pip install psycopg2-binary`

--
You received this message because you are subscribed to the Google Groups "PsiTurk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psiturk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psiturk/8fe2f6bb-4242-439b-99d3-4e53c3e746d5n%40googlegroups.com.

Buddhika Bellana

unread,
Jan 4, 2022, 1:21:34 PM1/4/22
to PsiTurk
Thanks, Dave. Tried that and I get:
`Requirement already satisfied: psycopg2-binary in /miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages (2.9.3)`

B

Buddhika Bellana

unread,
Jan 4, 2022, 1:25:22 PM1/4/22
to PsiTurk
Could it be an OS issue? I use Mac OS X 10.13. This is an excerpt from the traceback I posted above:

`ImportError: dlopen(/miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so, 2): Symbol not found: ____chkstk_darwin
  Referenced from: /miniconda3/envs/glendon_psiturk3/lib/python3.8/site-packages/psycopg2/.dylibs/libcrypto.1.1.dylib (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib`

B

Dave Eargle

unread,
Jan 4, 2022, 1:46:20 PM1/4/22
to Buddhika Bellana, PsiTurk
Yeah it seems something to do with psycopg2 and mac osx. I internet-searched that "Symbol not found ___" line and saw general suggestions to uninstall and reinstall the psycopg2 package. Maybe uninstall the binary one and try just the regular one, but I don't have a mac so I can't help much.

pip uninstall psycopg2-binary
pip install psycopg2

Buddhika Bellana

unread,
Jan 4, 2022, 2:03:00 PM1/4/22
to PsiTurk
Wow...that worked for me! Thanks so much!

B
Reply all
Reply to author
Forward
0 new messages