On Fri, Apr 13, 2012 at 3:59 AM, badc0re <[email protected]> wrote:
> the modules are working if they are in the same folder but i created the
> folder SE_controller and append the path for it but it is not working.

Does the folder SE_controller has __init__.py inside it ? That
required for python to recognize the folder as a package:-

$ ls  SE_controller
__init__.py SE_text_query SE_text_parser

> Code:
>
> # -*- coding: utf-8 -*-
> import sys, os
> sys.path.append('/home/baddc0re/Desktop/htdocs') # the folder with the
> modules needer
> sys.path.append('/opt/hypertable/0.9.5.6/lib/py')
> sys.path.append('/opt/hypertable/0.9.5.6/lib/py/gen-py')
> sys.path.append('/usr/lib/python2.7/site-packages')
> from SE_controller.SE_text_parser import * #the error
> from SE_controller.SE_text_query import * #the error
> from hypertable.thriftclient import *
> from hyperthrift.gen.ttypes import *
> def application(environ, start_response):
>     status = '200 OK'
>     output = 'Hello World!>'
>     response_headers = [('Content-type', 'text/plain'),
>                         ('Content-Length', str(len(output)))]
>     start_response(status, response_headers)
>
>
>     return [output]

You can try debug this by executing the script with python and see if
you can import the module. Run this from some other directory:-

$ python /home/baddc0re/Desktop/htdocs/index.wsgi

does it run without error ? If not then definitely the import path is
wrong and not a problem with mod_wsgi. Check what sys.path contain by
placing the pdb inside the code:-

import sys, os
sys.path.append('/home/baddc0re/Desktop/htdocs') # the folder with the
modules needer
sys.path.append('/opt/hypertable/0.9.5.6/lib/py')
sys.path.append('/opt/hypertable/0.9.5.6/lib/py/gen-py')
sys.path.append('/usr/lib/python2.7/site-packages')

import pdb;pdb.set_trace()

from SE_controller.SE_text_parser import *

Now when you run it as:-

$ python /home/baddc0re/Desktop/htdocs/index.wsgi

You'll be dropped into pdb console. Print out what sys.path contains:-

pdb > sys.path

Finally, what is the output of:-

$ which python

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to