Web app dev server Ubuntu/Linux setup help

54 views
Skip to first unread message

Bryce Matsuda

unread,
Feb 18, 2016, 2:01:04 PM2/18/16
to thebluealliance-developers
Hey all,

I'm interested in hacking away at the web app. I've followed the setup instructions in installing libraries and stuff okay (I think), but when I want to launch a dev server, setup gets a bit different since Ubuntu/Linux has no GUI for the Google App Engine Launcher (the only workarounds I've found are outdated.).

I've tried the following instructions on the command line:
<install Node.js libraries globally>
<setup and activate Python virtualenv...>
<install Python libraries through pip install>
<clone GitHub fork>
cd the-blue-alliance/
paver setup
<paver does its stuff>
~/google_appengine/dev_appserver.py --port 8088 dispatch.yaml app.yaml app-backend-tasks.yaml

And then I get a blank screen with the following stack trace. Not sure where to go from there.

Let me know if there are better instructions for setting this up properly.

Phil Lopreiato

unread,
Feb 18, 2016, 2:08:00 PM2/18/16
to theblueallian...@googlegroups.com
I do all my TBA development on fedora/linux, so it's definitely possible. This stack trace looks like an error I've seen in the past. Now if I can only remember a solution...

I think it has something to do with PYTHONPATH locations. I believe that some of the installs (maybe one on the npm ones) also creates a google python module and it conflicts with the app engine one. I believe I figured it out by opening a python shell and trying to import things, printing out the module locations, and just poking around the directories to confirm what was stored where. I ended up fixing it by symlinking one google module into the other, so the imports would work.

Sorry I can't remember more clearly, but I can poke around in a bit a little later and try and figure out some more details.

Phil



Phil Lopreiato
--
You received this message because you are subscribed to the Google Groups "thebluealliance-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-dev...@googlegroups.com.
To post to this group, send email to theblueallian...@googlegroups.com.
Visit this group at https://groups.google.com/group/thebluealliance-developers.
For more options, visit https://groups.google.com/d/optout.

Bryce Matsuda

unread,
Mar 1, 2016, 10:42:23 PM3/1/16
to thebluealliance-developers
Any updates on this?


On Thursday, February 18, 2016 at 11:08:00 AM UTC-8, Phil Lopreiato wrote:
I do all my TBA development on fedora/linux, so it's definitely possible. This stack trace looks like an error I've seen in the past. Now if I can only remember a solution...

I think it has something to do with PYTHONPATH locations. I believe that some of the installs (maybe one on the npm ones) also creates a google python module and it conflicts with the app engine one. I believe I figured it out by opening a python shell and trying to import things, printing out the module locations, and just poking around the directories to confirm what was stored where. I ended up fixing it by symlinking one google module into the other, so the imports would work.

Sorry I can't remember more clearly, but I can poke around in a bit a little later and try and figure out some more details.

Phil



Phil Lopreiato
On 02/18/2016 02:01 PM, Bryce Matsuda wrote:
Hey all,

I'm interested in hacking away at the web app. I've followed the setup instructions in installing libraries and stuff okay (I think), but when I want to launch a dev server, setup gets a bit different since Ubuntu/Linux has no GUI for the Google App Engine Launcher (the only workarounds I've found are outdated.).

I've tried the following instructions on the command line:
<install Node.js libraries globally>
<setup and activate Python virtualenv...>
<install Python libraries through pip install>
<clone GitHub fork>
cd the-blue-alliance/
paver setup
<paver does its stuff>
~/google_appengine/dev_appserver.py --port 8088 dispatch.yaml app.yaml app-backend-tasks.yaml

And then I get a blank screen with the following stack trace. Not sure where to go from there.

Let me know if there are better instructions for setting this up properly.
--
You received this message because you are subscribed to the Google Groups "thebluealliance-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-developers+unsub...@googlegroups.com.

Greg Marra

unread,
Mar 2, 2016, 1:12:13 AM3/2/16
to thebluealliance-developers
It sounds like this is a problem with your python installation. https://github.com/rg3/youtube-dl/issues/94

Do you know if your python installation has ctypes installed correctly? Have you tried importing it from an interactive python session on the command line?

To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-dev...@googlegroups.com.
To post to this group, send email to theblueallian...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "thebluealliance-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-dev...@googlegroups.com.

Bryce Matsuda

unread,
Mar 2, 2016, 2:39:09 PM3/2/16
to thebluealliance-developers
It seems to import fine in the interactive command line, both with and without running virtualenv.

Going off of what Phil mentioned earlier, I did find a Python module that symlinks virtualenv packages so that Google App Engine can use them. I followed the instructions provided, but it still throws the same stack trace.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-developers+unsub...@googlegroups.com.
To post to this group, send email to theblueallian...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "thebluealliance-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-developers+unsub...@googlegroups.com.

Phil Lopreiato

unread,
Mar 2, 2016, 3:00:11 PM3/2/16
to theblueallian...@googlegroups.com
What is your PYTHONPATH environment variable?

If you open a python shell, import ctypes, then print ctypes.__file__ it will show you the location of the module. Make sure that is in your PYTHONPATH var?

Phil



Phil Lopreiato
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-dev...@googlegroups.com.

Bryce Matsuda

unread,
Mar 2, 2016, 5:04:35 PM3/2/16
to thebluealliance-developers
I had no PYTHONPATH env variable at first. (echoing it came up blank)

I imported ctypes and _ctypes in the shell, their locations were "/usr/lib/python2.7/ctypes/__init__.pyc" and "/usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so" respectively.

In my .profile I put "export PYTHONPATH="${PYTHONPATH}:/usr/lib/python2.7/ctypes:/usr/lib/python2.7/lib-dynload/" and sourced it/restarted command line.

Still same error.

Current regular non-virtualenv sys.path

['', '/usr/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/dist-packages/pip-8.0.3-py2.7.egg', '/home/brycematsuda', '/usr/lib/python2.7/ctypes', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']

Current regular virtualenv sys path
['', '/home/brycematsuda', '/usr/lib/python2.7/ctypes', '/usr/lib/python2.7/lib-dynload', '/home/brycematsuda/virtualenv/lib/python2.7', '/home/brycematsuda/virtualenv/lib/python2.7/plat-x86_64-linux-gnu', '/home/brycematsuda/virtualenv/lib/python2.7/lib-tk', '/home/brycematsuda/virtualenv/lib/python2.7/lib-old', '/home/brycematsuda/virtualenv/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/home/brycematsuda/virtualenv/local/lib/python2.7/site-packages', '/home/brycematsuda/virtualenv/lib/python2.7/site-packages']

Current sys path on startup
['/home/brycematsuda/github/the-blue-alliance/gaenv', '/home/brycematsuda/github/the-blue-alliance', '/home/brycematsuda/google_appengine', '/home/brycematsuda/google_appengine', '/usr/lib/python2.7/lib-dynload', '/home/brycematsuda/virtualenv/lib/python2.7', '/usr/lib/python2.7', '/home/brycematsuda/google_appengine/lib/django-1.5', '/home/brycematsuda/google_appengine/lib/numpy-1.6.1', '/home/brycematsuda/google_appengine/lib/endpoints-1.0', '/home/brycematsuda/google_appengine/lib/pycrypto-2.6', '/home/brycematsuda/google_appengine/lib/jinja2-2.6', '/home/brycematsuda/google_appengine/lib/markupsafe-0.15', '/home/brycematsuda/google_appengine/lib/setuptools-0.6c11', '/home/brycematsuda/google_appengine/lib/protorpc-1.0', '/home/brycematsuda/google_appengine/lib/webapp2-2.3', '/home/brycematsuda/google_appengine/lib/webob-1.1.1', '/home/brycematsuda/google_appengine/lib/yaml-3.10']

(gaenv is the folder where the symlinks to the virtualenv libraries are)
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-developers+unsubsc...@googlegroups.com.
To post to this group, send email to theblueallian...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "thebluealliance-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-developers+unsub...@googlegroups.com.
To post to this group, send email to theblueallian...@googlegroups.com.
Visit this group at https://groups.google.com/group/thebluealliance-developers.
For more options, visit https://groups.google.com/d/optout.

Bryce Matsuda

unread,
Mar 10, 2016, 5:40:31 AM3/10/16
to thebluealliance-developers
After many hours of googling, reinstalling Python and barfing my Python paths all over my console, I think I found a workaround.

So you know how in the app.yaml (and on the Google website) it has numpy 1.6.1 as a supported version? I decided to create an entirely new virtualenv, but this time install specifically numpy 1.6.1 from pip instead of the latest version (which is 1.10.something I think) And, huzzah, I made it to the home page!

I don't think it had anything to do with symlinks or paths because the correct location of ctypes came up everytime I printed the sys.path of the TBA app and numpy. GAE might be doing something weird behind the scenes that causes numpy to be confused in later versions or something. ¯\_(ツ)_/¯ It was importing fine when I ran it from the interactive console.

If I have free time later on, I might add Linux-specific setup instructions to the README.

Greg Marra

unread,
Mar 10, 2016, 11:10:58 AM3/10/16
to thebluealliance-developers

Glad to hear you were able to debug this! Looking forward to working with you :)


To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-developers+unsub...@googlegroups.com.
To post to this group, send email to theblueallian...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "thebluealliance-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-dev...@googlegroups.com.

To post to this group, send email to theblueallian...@googlegroups.com.
Visit this group at https://groups.google.com/group/thebluealliance-developers.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "thebluealliance-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-dev...@googlegroups.com.

To post to this group, send email to theblueallian...@googlegroups.com.
Visit this group at https://groups.google.com/group/thebluealliance-developers.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "thebluealliance-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thebluealliance-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages