I am trying to set up PyBOSSA on an AWS EC2 instance running Ubuntu 18.04 LTS. I am following the official instructions and have encountered three errors so far.
- sudo apt-get install -y git postgresql postgresql-all postgresql-server-dev-all libpq-dev python-psycopg2 libsasl2-dev libldap2-dev libssl-dev python-virtualenv python-dev build-essential libjpeg-dev libssl-dev libffi-dev dbus libdbus-1-dev libdbus-glib-1-dev libldap2-dev libsasl2-dev python-pip python3-pip redis-server
- cd ~
- git clone –recursive https://github.com/Scifabric/pybossa
- cd pybossa
- virtualenv -p python3 env (I’m using Python3 explicitly as my system also has Python 2.7 installed).
- source env/bin/activate
- pip install -U pip
- pip install -r ~/pybossa/requirements.txt
At this point, I start getting error messages… I have copied the stdout and stderr into a file, which I have uploaded here.
I’m not sure if the errors there are what have caused my later errors, but I pushed on through the instructions anyway in hopes it’d work…
- cp settings_local.py.tmpl settings_local.py
- cp alembic.ini.template alembic.ini
- redis-server contrib/sentinel.conf –sentinel
I noted that the Redis server version was 4.0.9 (the instructions say it needs to be v2.6 or greater).
The output from starting the Redis server was as follows:
30284:X 30 Mar 03:09:22.004 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
30284:X 30 Mar 03:09:22.004 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=30284, just started
30284:X 30 Mar 03:09:22.004 # Configuration loaded
…I gather that’s ok…
- rqscheduler –host 127.0.0.1
This command wasn’t installed on my system. I tried to use apt to install it, but there was nothing there. I also tried apt install rq rqscheduler rq-scheduler – nothing found. I then Googled and found the website for rq-scheduler, and found that I could install it by running pip install rq-scheduler
That installed correctly. Nonetheless, running the command rqscheduler --host 127.0.0.1
in the terminal still failed: rqscheduler: command not found
.
Knowing that it was a Python package, I wondered if maybe I needed to prepend python3 onto the start of the command: python3 rqscheduler --host 127.0.0.1
. Response: python3: can't open file 'rqscheduler': [Errno 2] No such file or directory
.
I also tried pip3 install rq-scheduler
(which installed fine) and then running the command, but encountered the same error.
I would appreciate knowing how to get that running, but for the purpose of this test, I skipped setting up Regis and the scheduler, and continued with the PyBOSSA instructions:
- sudo su postgres
- createuser -d -P pybossa
- (Password set)
- createdb pybossa -O pybossa
- exit
- python3 cli.py db_create
…and then I got this error:
File "cli.py", line 162
'''SELECT id, created FROM task_run WHERE created LIKE ('x%')''')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 54-55: truncated xXX escape
I instead tried python cli.py db_create
, just in case it’d work, and got a different error:
python cli.py db_create
ValueError: invalid x escape
So I’m seeing three separate issues:
- Installing the PyBOSSA-required Python packages.
- The issue with the rqscheduler command.
- The error when starting the PyBOSSA server.
What do these errors mean?
2
Answers
1 ) For the installation, try this:
Which ended with no error.
2) Try :
or
3) The
char need to be escaped (like
\
) in python.So you may alter the
cli.py
line 162 (using text editor) from:To:
But it will be better to be fixed by dev on github …
CONCLUSION
According to official documentation,
The PYBOSSA python3 version is freshly migrated so finaly is not very stable … I expect that it will be better to use the PYBOSSA python2.7 branch and follow exactly the documentation.
And according to official github account they try to make money with support (?…)
The issue has now been fixed for the master branch (https://github.com/Scifabric/pybossa/pull/1986). You can fetch the new code and use it.