Ricardo- yes, importing httplib2 throws the same error, even without 
importing oauth.

We've noticed that the problem does not arise with the new relic import 
statment on the first line, 
but only on the second line, when the new relic agent is initialized.

import newrelic.agent # Doesn't cause error when httplib2 imported later
newrelic.agent.initialize('/opt/web-apps/web2py/newrelic.ini')# DOES cause 
error 





On Monday, April 29, 2013 5:00:37 PM UTC-4, Ricardo Pedroso wrote:
>
> On Mon, Apr 29, 2013 at 9:30 PM, Yarin Kessler 
> <[email protected]<javascript:>> 
> wrote: 
> > Yes, we have httplib2 installed in our modules folder, and the 
> python-oauth2 
> > lib runs fine if we don't import the new relic agent first. Likewise, 
> the 
> > new relic works fine and we get no errors if we never call import 
> oauth2. 
> > It's only when both are imported. 
>
> What happen if you import httplib2 instead of oauth2 (or before import 
> oauth2) 
> with newrelic imported first? 
>
> Ricardo 
>
>
>
> > 
> > 
> > On Mon, Apr 29, 2013 at 3:51 PM, Niphlod <[email protected] <javascript:>> 
> wrote: 
> >> 
> >> are you positive that you have httplib2 installed (and available)? 
> >> 
> >> custom_import machinery is tricky and the most complete picture should 
> be 
> >> in Massimo's end..... 
> >> 
> >> for starters, let's be sure that httplib2 is installed ^_^ 
> >> 
> >> 
> >> On Monday, April 29, 2013 9:45:21 PM UTC+2, Yarin wrote: 
> >>> 
> >>> We're trying to integrate New Relic with web2py. We installed it per 
> >>> their instructions for web2py running on mod_wsgi, adding the 
> following 
> >>> lines in wsgihandler.py: 
> >>> 
> >>> import newrelic.agent 
> >>> newrelic.agent.initialize('/opt/web-apps/web2py/newrelic.ini') 
> >>> 
> >>> right before 
> >>> import gluon.main 
> >>> 
> >>> This seems to work fine, until we import another library our app uses 
> >>> called python-oauth2. Then we get the following error: 
> >>> 
> >>> 
> >>>     import oauth2 as oauth 
> >>>   File "/opt/web-apps/web2py/gluon/custom_import.py", line 95, in 
> >>> custom_importer 
> >>> 
> >>> 
> >>>     raise e2  # there is an error in the module 
> >>> KeyError: 'httplib2' 
> >>> 
> >>> 
> >>> I want to report this problem to New Relic, but am unsure what the 
> root 
> >>> cause might be. Is anyone familiar enough with the custom_importer to 
> >>> venture a guess? 
> >>> 
> >> -- 
> >> 
> >> --- 
> >> You received this message because you are subscribed to a topic in the 
> >> Google Groups "web2py-users" group. 
> >> To unsubscribe from this topic, visit 
> >> https://groups.google.com/d/topic/web2py/5r2YXTa9vAo/unsubscribe?hl=en. 
>
> >> To unsubscribe from this group and all its topics, send an email to 
> >> [email protected] <javascript:>. 
> >> For more options, visit https://groups.google.com/groups/opt_out. 
> >> 
> >> 
> > 
> > 
> > -- 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "web2py-users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to