Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(subprocess): Overwrite PYTHONHOME variable to it works on Rhino 8 #461

Merged
merged 1 commit into from Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions lbt_recipes/recipe.py
Expand Up @@ -310,14 +310,18 @@ def run(self, settings=None, radiance_check=False, openstudio_check=False,

# execute command
shell = False if os.name == 'nt' and not silent else True
custom_env = os.environ.copy()
custom_env['PYTHONHOME'] = ''
if settings.report_out:
process = subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
shell=shell, env=custom_env
)
result = process.communicate()
print(result[0])
print(result[1])
else:
process = subprocess.Popen(command, shell=shell)
process = subprocess.Popen(command, shell=shell, env=custom_env)
result = process.communicate() # freeze the canvas while running
return folder

Expand Down