问题
How can I get python interpreter path in uwsgi process (if I started it with -h parameter)? I tryed to use VIRTUAL_ENV and UWSGI_PYHOME environment variables, but they are empty, I do not know why. Also i tryed to use sys.executable
, but it points to uwsgi process path.
回答1:
uWSGI is not a python application (it only calls libpython functions) so the effective executable is the uwsgi binary. If you use virtualenvs you can assume the binary is in venv/bin/python
来源:https://stackoverflow.com/questions/18014122/how-to-get-python-interpreter-path-in-uwsgi-process