I'm writing vim-script(s) that utilizes vim's embedded Python environment. One of these requires the Python Environment to utilize a virtual environment. Ideally for this application, vim would simply inherit the virtual environment settings from the shell that launched vim.

However this_answer informs me that vim uses its own 'embedded' Python Interpreter. I've experimented and some of the environment variable settings from the parent process, for example VIRTUAL_ENV IS set correctly. But but Python's sys.path definitely isn't honoring the virtual environment settings.

Here's the question: how does vim's pythonthreedll & pythonthreehome options affect this behavior? From vim's help:

'pythonthreedll' Specifies the name of the Python 3 shared library. The default is DYNAMIC_PYTHON3_DLL, which was specified at compile time.

Environment variables are expanded |:set_env|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons.