The situation is like this:
in my
httpd.conf, I haveSetEnv PYTHONPATH /Users/<MY_NAME_>/PATH_TO/py3my Python script in a browser runs, prints something like a header, and then I print from it the environment like
[(x, os.environ [x]) for x in os.environ if "PY" in x]
I can see this path to my Python stuff printed. It is in the Apache environment.
However the next line in my script, which is:
from my_module import * # module **is** in the directory which is in PYTHONPATH
gives an error:
ModuleNotFoundError: No module named '....'
This doesn't make sense to me.
This is under macOS 13.6.3 Ventura.
PYTHONPATH=foo python3 -c 'from my_module import *'(and did you mean to respond to yourself?)