Is the newrelic module installed into a Python virtual environment or into a real Python installation?
That it is not found suggests a few possibilities. 1. The mod_wsgi is compiled against a different Python version. 2. You have a distinct Python 2.7 installation (system wide one) which is different to the one you are expecting it to use, and mod_wsgi is compiled against or using the other installation. 3. You are using a virtual environment but haven't told mod_wsgi how to use it. I would suggest going through the following checklist. 1. Work out what version of mod_wsgi is compiled against. First up by looking at what libpythonX.Y.so it is using. http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python_Shared_Library 2. Work out what Python installation, version and location, mod_wsgi is using at run time. http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python_Installation_In_Use 3. Also validate whether mod_wsgi is running your application in embedded or daemon mode and whether that is what you expect. http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Embedded_Or_Daemon_Mode http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Sub_Interpreter_Being_Used Supply the results of that as well as what you have for the WSGI directives in your Apache configuration. Graham On 29/07/2013, at 6:59 PM, virgil.balibanu <[email protected]> wrote: > The problem seems to be the import: > ImportError: No module named newrelic.agent but if I try the import from > python2.7 or I run python2.7 django.wsgi it works ok. > > On Monday, July 29, 2013 11:30:32 AM UTC+3, virgil.balibanu wrote: > Hi, > > I'm trying to install new relic on my demo server. It runs python+django on > mod_wsgi on centos. In my djnago.wsgi file I try to do this: > > import newrelic.agent > newrelic.agent.initialize('newrelic.ini') > > import os > import sys > > sys.path.append('/home/projects') > sys.path.append('/home/projects/sbo') > > os.environ['DJANGO_SETTINGS_MODULE'] = 'sbo.settings' > > import django.core.handlers.wsgi > application = django.core.handlers.wsgi.WSGIHandler() > > But it keep failing. Internal server error. It fails even if a leave only the > import. But newrelic is installed and in python2.7 which I use I can use the > import. > > Any ideea why it might fail? > > Thanks, > Virgil Balibanu > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/groups/opt_out.
