|
From: John P. R. <ro...@cs...> - 2024-02-07 21:30:59
|
Hi Tonu:
In message
<CAB...@ma...> ,
Tonu Mikk writes:
>The command
> python3 -c 'import roundup'
>runs without an error.
Stupid idea does:
python3 -c 'import sys;print(sys.version); print(sys.prefix);'
print the same as your test_wsgi? I expect it will.
Also can you run:
python3 -c 'import roundup; print(roundup)'
to see where the library is? It's possible you have it installed in
some odd place that the wsgi python invocation isn't looking. Do you
have PYTHONPATH set in your environment per chance?
Also running:
python3 -c 'import sys; print("\n".join(sys.path))'
or printing sys.path from test_wsgi may give us some more info.
If that's the case, you can add:
# Add the directory with the roundup installation
# subdirectory to the python path.
sys.path.insert(0, '/home/roundup/install/lib/python')
to the wsgi script as mentioned in a couple of places on the
installation page (search for sys.path).
>I changed the test_wsgi.py to contain this:
>import sys
>
>def application(environ, start_response):
> status = '200 OK'
>
> output = u''
> output += u'sys.version = %s\n' % repr(sys.version)
> output += u'sys.prefix = %s\n' % repr(sys.prefix)
>
> response_headers = [('Content-type', 'text/plain'),
> ('Content-Length', str(len(output)))]
> start_response(status, response_headers)
>
> return [output.encode('UTF-8')]
>
>Now the output in the browser shows:
>sys.version = '3.9.18 (main, Sep 7 2023, 00:00:00) \n[GCC 11.4.1 20230605
>(Red Hat 11.4.1-2)]'
>sys.prefix = '/usr'
>
>I will try to use the virtual environment with mod_wsgi. Thanks for
>pointing this out!
That's the more resiliant way to do it, but I would like to get to the
bottom of the issue you had with a os native installation.
Have a great day.
--
-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
|