Search path for Python executable on Windows
draustin opened this issue · comments
I'm using Python 3.8 in a virtual environment provided by Poetry running on Windows 10. I find that the Python executable called by Codeweave does not respect the Windows PATH environment variable. Instead of calling the Python executable of the currently activated virtual environment (that Codebraid itself is running in), it calls a Windows system Python. By default, this produces a message referring you to the Microsoft store, and this message appears in the output HTML!
I tracked the issue down to the calls to subprocess.run
in _subproc_default
. There is a known issue with subprocess:
https://bugs.python.org/issue15451
From this Stack Overflow answer I was able to fix the problem by inserting the following at the beginning of _subproc_default
args = [shutil.which(args[0])] + args[1:]
Thank you for Codebraid!