Re: wsgi on RedHat 9
Tonu Mikk via Roundup-users <[email protected]> Wed, 7 Feb 2024 15:47:36 -0600
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <CABDFm8i32HuvXujgZKQ52E3M1HtG7YenYktyfT_JrQSiyL7uQQ@mail.gmail.com> |
--===============5467061852928788195==
Content-Type: multipart/alternative; boundary="000000000000bf1b220610d1a6d9"
--000000000000bf1b220610d1a6d9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Thanks for these additional ideas! I am now seeing where the problem is.
The command
python3 -c 'import sys;print(sys.version); print(sys.prefix);' shows the
same information as the test_wsgi output:
3.9.18 (main, Sep 7 2023, 00:00:00)
[GCC 11.4.1 20230605 (Red Hat 11.4.1-2)]
/usr
When running
python3 -c 'import roundup; print(roundup)'
I get:
<module 'roundup' from
'/home/tmikk/.local/lib/python3.9/site-packages/roundup/__init__.py'>
I had started the roundup install by first creating a python virtual
environment in my home directory and then installing roundup there using
pip. Looks like this is where my problem is. I don't even see roundup in
/usr/lib64/python3.9/site-packages.
I hadn't set the PYTHONPATH environment variable.
The command
python3 -c 'import sys; print("\n".join(sys.path))'
gives me this output.
/usr/lib64/python39.zip
/usr/lib64/python3.9
/usr/lib64/python3.9/lib-dynload
/home/tmikk/.local/lib/python3.9/site-packages
/usr/lib64/python3.9/site-packages
/usr/lib/python3.9/site-packages
On Wed, Feb 7, 2024 at 3:30=E2=80=AFPM John P. Rouillard <[email protected]=
> wrote:
> Hi Tonu:
>
> In message
> <CABDFm8jpdukd-rbVbpcKxnFHPEgCuZK7NPTfveSKLZvCMVEbjA@mail.gmail.com> ,
> 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 =3D '200 OK'
> >
> > output =3D u''
> > output +=3D u'sys.version =3D %s\n' % repr(sys.version)
> > output +=3D u'sys.prefix =3D %s\n' % repr(sys.prefix)
> >
> > response_headers =3D [('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 =3D '3.9.18 (main, Sep 7 2023, 00:00:00) \n[GCC 11.4.1 2023=
0605
> >(Red Hat 11.4.1-2)]'
> >sys.prefix =3D '/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
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
> My employers don't acknowledge my existence much less my opinions.
>
--=20
Tonu Mikk
Developer | Disability Resource Center | disability.umn.edu
University of Minnesota | umn.edu
[email protected]
Pronouns: He/Him
--000000000000bf1b220610d1a6d9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Thanks for these additional ideas! I am now seeing where t=
he problem is.=C2=A0<div><br></div><div>The command=C2=A0</div><div>python3=
-c 'import sys;print(sys.version); print(sys.prefix);' shows the s=
ame information as the test_wsgi output:<br></div><div>3.9.18 (main, Sep =
=C2=A07 2023, 00:00:00)<br>[GCC 11.4.1 20230605 (Red Hat 11.4.1-2)]<br>/usr=
<br></div><div><br></div><div>When running=C2=A0</div><div>=C2=A0 =C2=A0pyt=
hon3 -c 'import roundup; print(roundup)'<br></div><div>I get:</div>=
<div><module 'roundup' from '/home/tmikk/.local/lib/python3.=
9/site-packages/roundup/__init__.py'><br></div><div>I had started th=
e roundup install by first creating a python virtual environment in my home=
directory and then installing roundup there using pip. Looks like this is =
where my problem is.=C2=A0I don't even see roundup in /usr/lib64/python=
3.9/site-packages.=C2=A0</div><div><br></div><div>I hadn't set the PYTH=
ONPATH environment variable.=C2=A0</div><div><br></div><div>The command=C2=
=A0</div><div>python3 -c 'import sys; print("\n".join(sys.pat=
h))'<br></div><div><br></div><div>gives me this output.</div><div>/usr/=
lib64/python39.zip<br>/usr/lib64/python3.9<br>/usr/lib64/python3.9/lib-dynl=
oad<br>/home/tmikk/.local/lib/python3.9/site-packages<br>/usr/lib64/python3=
.9/site-packages<br>/usr/lib/python3.9/site-packages<br></div><div><br></di=
v></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr=
">On Wed, Feb 7, 2024 at 3:30=E2=80=AFPM John P. Rouillard <<a href=3D"m=
ailto:[email protected]">[email protected]</a>> wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
solid rgb(204,204,204);padding-left:1ex">Hi Tonu:<br>
<br>
In message<br>
<<a href=3D"mailto:CABDFm8jpdukd-rbVbpcKxnFHPEgCuZK7NPTfveSKLZvCMVEbjA@m=
ail.gmail.com" target=3D"_blank">CABDFm8jpdukd-rbVbpcKxnFHPEgCuZK7NPTfveSKL=
[email protected]</a>> ,<br>
Tonu Mikk writes:<br>
>The command<br>
>=C2=A0 =C2=A0python3 -c 'import roundup'<br>
>runs without an error.<br>
<br>
Stupid idea does:<br>
<br>
=C2=A0 =C2=A0python3 -c 'import sys;print(sys.version); print(sys.prefi=
x);'<br>
<br>
print the same as your test_wsgi? I expect it will.<br>
<br>
Also can you run:<br>
<br>
=C2=A0 =C2=A0python3 -c 'import roundup; print(roundup)'<br>
<br>
to see where the library is? It's possible you have it installed in<br>
some odd place that the wsgi python invocation isn't looking. Do you<br=
>
have PYTHONPATH set in your environment per chance?<br>
<br>
Also running:<br>
<br>
=C2=A0 python3 -c 'import sys; print("\n".join(sys.path))'=
;<br>
<br>
or printing sys.path from test_wsgi may give us some more info.<br>
<br>
If that's the case, you can add:<br>
<br>
=C2=A0 # Add the directory with the roundup installation<br>
=C2=A0 # subdirectory to the python path.<br>
=C2=A0 sys.path.insert(0, '/home/roundup/install/lib/python')<br>
<br>
to the wsgi script as mentioned in a couple of places on the<br>
installation page (search for sys.path).<br>
<br>
>I changed the test_wsgi.py to contain this:<br>
>import sys<br>
><br>
>def application(environ, start_response):<br>
>=C2=A0 =C2=A0 status =3D '200 OK'<br>
><br>
>=C2=A0 =C2=A0 output =3D u''<br>
>=C2=A0 =C2=A0 output +=3D u'sys.version =3D %s\n' % repr(sys.ve=
rsion)<br>
>=C2=A0 =C2=A0 output +=3D u'sys.prefix =3D %s\n' % repr(sys.pre=
fix)<br>
><br>
>=C2=A0 =C2=A0 response_headers =3D [('Content-type', 'text/=
plain'),<br>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 ('Content-Length', str(len(output)))]<br>
>=C2=A0 =C2=A0 start_response(status, response_headers)<br>
><br>
>=C2=A0 =C2=A0 return [output.encode('UTF-8')]<br>
><br>
>Now the output in the browser shows:<br>
>sys.version =3D '3.9.18 (main, Sep=C2=A0 7 2023, 00:00:00) \n[GCC 1=
1.4.1 20230605<br>
>(Red Hat 11.4.1-2)]'<br>
>sys.prefix =3D '/usr'<br>
><br>
>I will try to use the virtual environment with mod_wsgi. Thanks for<br>
>pointing this out!<br>
<br>
That's the more resiliant way to do it, but I would like to get to the<=
br>
bottom of the issue you had with a os native installation.<br>
<br>
Have a great day.<br>
--<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -- rouilj<br>
John Rouillard<br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
<br>
My employers don't acknowledge my existence much less my opinions.<br>
</blockquote></div><br clear=3D"all"><div><br></div><span class=3D"gmail_si=
gnature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><d=
iv dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><span sty=
le=3D"border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"=
><font color=3D"#666666"><div>Tonu Mikk</div><div>Developer | Disability Re=
source Center | <a href=3D"https://disability.umn.edu" target=3D"_blank">di=
sability.umn.edu</a></div><div>University of Minnesota | <a href=3D"http://=
umn.edu" target=3D"_blank">umn.edu</a>=C2=A0</div><div><a href=3D"mailto:tm=
[email protected]" target=3D"_blank">[email protected]</a>=C2=A0</div><div>Pronouns: =
He/Him</div></font></span></div></div></div></div></div>
--000000000000bf1b220610d1a6d9--
--===============5467061852928788195==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============5467061852928788195==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Roundup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/roundup-users
--===============5467061852928788195==--