-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using nfldb / nflgame with Google AppEngine (et al) #53
Comments
In general,
I don't really know anything about Google AppEngine. Could you please tell me how you got Note that
Ah, OK. In the future, when describing a problem, please include the exact steps (i.e., the commands you ran) to get into your current state. There are so many ways to install Python modules that it is absolutely impossible for me to know what your problem is from a generic Does this help? http:https://stackoverflow.com/questions/23717834/importerror-no-module-named-psycopg2-after-install |
I went through the installation process again without incident, following the instructions found at: https://github.com/BurntSushi/nfldb/wiki/Windows-Install The nflgame and nfldb modules both work as advertised, from the command line. And again, importing nflgame works within AppEngine too when I use the import sys code snippet in my first post. It's only when I try to import nfldb into an AppEngine file that the dependency psycopg2 is not found. I guess my question straddles the gamuts of Python and pyscopg2, and it's not actually an nfldb-specific issue. I'm ignorant as a programmer on the various ways one imports modules and their dependencies. I thought you might see something obvious that I didn't do or try. I realize Python, Psycopg2 and AppEngine are outside your scene, and I'm thankful for your attention thus far :) No worries, I am definitely satisfied and excited with the nflgame, and I can still use nfldb locally without AppEngine. Thanks again for your time! For what it's worth: Windows 7 64bit
All successful! |
No worries. I'm happy to help at any part of the install process. Here's the thing. You gave me a pretty good list of what you did to get it working on Windows. But your problem is with getting it working on Google AppEngine. As far as I can see, you've provided no details on what you've tried other than " I also linked to a SO post that might be of help. But without knowing more about what you've done on Google AppEngine, it's hard to give more help...
Yup. But first, I need to know what you did! :-) |
I think the problem is that Google AppEngine (GAE) does not support the Psycopg2 module. To be clear, I'm using AppEngine on my local machine. It provides a server and Python27 support. I have not tried to Deploy to Google's cloud (yet). >>> Sorry for any confusion. <<< Although I will try to deploy nflgame later. You've asked me what steps got me to my current state, but I haven't done anything more than use the GAE GUI to create a new project on my local machine, and then edit the simple "main.py" file to include the nfl... modules. Main.py imports webapp2 (framework included with GAE) and then creates a Main class to handle HTTP GET requests to the "" url (route). GAE projects also use an "app.yaml" file where the webapp2 module is ALSO specified, in addition to "main.py" I didn't have to edit this file to get nflgame to work. However, I tried copying the psycopg2 from \site-packages to the Google AppEngine \lib folder (so as to be a sibling of webapp2), and then edited the app.yaml (a config file) file, and finally got a new error message: EventError: the library "psycopg2" is not supported I think that solves that, but I have no idea why nflgame can be imported, but not Pyscopg2. It may be that modules without dependencies cannot be imported, but I dunno. I think it's wise to stop trying :) |
OK. That's really hard for me to debug because I don't know what the Google AppEngine GUI is or what it's doing. It's also weird to me that you're running AppEngine stuff locally. I thought GAE was a cloud computing platform. If you can find a way to use Copying installed Python modules from one machine to another is _never_ the right thing to do. In the case of |
After playing around with nfldb and nflgame in the Command Window, I tried to import nfldb into a HelloWorld.py project created in Google AppEngine for my local machine and was unable to use it because I couldn't get the app to find the third party psycopg2 module needed for Postgresql.
"No module named psycopg2._psycopg"
As I mentioned above, both modules work fine when I run in IDLE or Windows Command.
With AppEngine, I used the following successfully with nflgame, but it fails with nfldb due to the psycopg2 dependency:
import sys
sys.path.insert(0, 'C:\Python27\Lib\site-packages')
import nflgame
I'm a total rookie with nfldb and nflgame - Postgres, psycopg2, Python and AppEngine for that matter, but because the psycopg2 directory is a sibling of both nfldb and nflgame I can't think of a reason why it isn't found the way nflgame, and evidently nfldb are found.
Is there a different/better way to approach and accomplish this?
Thank you.
The text was updated successfully, but these errors were encountered: