9

I have a Python 2.7 GAE app that already has a lot of functionality. Now I want to integrate with a Google API.

Within my IDE (PyCharm) running on Mac OSX, I added the following lines to my app's main program:

import httplib2
pass

When I COMMAND-click "httplib2", the IDE opens "httplib2-0.8-py2.7.egg/httplib2/init.py" in an editor panel, so the IDE apparently knows where httplib2 is. But running the app, I get the error shown in the title.

To test further, I put breakpoints on both statements shown above and then run the app in debug mode. When it gets to the import statement, I immediately click the "Resume Program" icon.

The console then shows:

ImportError: No module named httplib2

The program then loops. That is, it doesn't terminate, but it never reaches the "pass" statement.

So the IDE seems to know where "httplib2" is, but Python doesn't seem to. Any help on how to get "import httplib2" to succeed will be appreciated. Thanks.

Lindsay
  • 1,461
  • 16
  • 26

1 Answers1

8

httplib2 is not a standard library that comes with Python, but rather an externally-developed, optional package. If you want it to be available on Google App Engine, you'll have to include it in your application.

icktoofay
  • 126,289
  • 21
  • 250
  • 231
  • Thanks for the reply. Since COMMAND-click shows that the IDE knows where it is, I thought that means that it is included in my application. If that's incorrect, please tell me what else I have to do. – Lindsay Mar 16 '13 at 23:25
  • 2
    @Lindsay: No, your IDE knows where it is because you installed it on your computer, and so it is available in every Python application on your computer. It is not explicitly in your application. You should be able to include it in your application by copying the `httplib2` directory into your application. – icktoofay Mar 16 '13 at 23:26