anaconda Virtual environments in Python Script TOP

   1321   2   0
User Avatar
Member
2 posts
Joined: April 2023
Online
when set to cook out of process the python script allows you to set a venv path. So I tried to set this up with an anaconda venv.

however even with a simple script with no module imports I get this error:


Traceback (most recent call last):
File "C:\PROGRA~1/SIDEEF~1/HOUDIN~1.547/houdini/pdg/types\schedulers\local.py", line 69, in spawn
proc = start_async(item_command, output_file, job_env, extra)
File "C:\PROGRA~1/SIDEEF~1/HOUDIN~1.547/houdini/pdg/types\schedulers\local.py", line 1228, in start_async
proc = subprocess.Popen(argv,
File "C:\PROGRA~1\SIDEEF~1\HOUDIN~1.547\python310\lib\subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\PROGRA~1\SIDEEF~1\HOUDIN~1.547\python310\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: The system cannot find the file specified

has anyone been successful in getting an anaconda environment to work here?
Edited by ltendava - Jan. 18, 2024 11:39:50

Attachments:
HouConda.png (32.6 KB)

User Avatar
Staff
613 posts
Joined: May 2014
Offline
The Venv Path parameter is intended to be used with environments created using the Python Virtual Environment TOP, which uses Python's built-in venv module to initialize the environment. It currrently does not work with virtual environments that require initializing a custom shell environment, e.g. Conda.
User Avatar
Member
111 posts
Joined: June 2017
Offline
Depending on the purpose of the python script, you may be able to use a generic generator to call a command on the system shell.
On macOS, I've used an .sh script to run an external python script in a conda environment. On Windows you can use a bat or ps1 script.
You may need to clear the PYTHINHOME andd PYTHONPATH environment variables inside the .sh script before activating the conda environment.
Edited by joostkonemann - Jan. 25, 2025 14:29:09
  • Quick Links