Skip to content
Snippets Groups Projects
Commit bcb4c9e7 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Merge branch 'webservice-venv-path' into 'master'

[Webservice] add environment bin/ to PATH if not already there

See merge request !944
parents f854869e ddcb2ca8
No related branches found
No related tags found
1 merge request!944[Webservice] add environment bin/ to PATH if not already there
...@@ -1536,6 +1536,14 @@ def main(argv: Optional[List[str]] = None): ...@@ -1536,6 +1536,14 @@ def main(argv: Optional[List[str]] = None):
format=fmt format=fmt
) )
# Ensure that subprocesses (to launch calibration) are launched with the
# venv where this is installed, even if it was not activated in a shell.
cmd_path = os.environ.get('PATH', os.defpath).split(os.pathsep)
my_env_bin = os.path.dirname(sys.executable)
if my_env_bin not in cmd_path:
logging.info("Adding %s to PATH", my_env_bin)
os.environ['PATH'] = os.pathsep.join([my_env_bin] + cmd_path)
# Launch the ZMQ server to handle requests for calibration # Launch the ZMQ server to handle requests for calibration
server = ActionsServer(config, mode) server = ActionsServer(config, mode)
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment