Executing python from vvvv, in virtual environment

I use Anaconda to create virtual environments to run python scripts. When doing this I end up with a terminal (cmd.exe) running in this virtual enevironment, with python libraries loaded that are specific to that script / project.

Is there a way I can do this from vvvv - I use shell execute with cmd.exe but running in the VE?

Also, any other good ways to integrate python shenanigans with vvvv?

x

not that i ever tried it in this context but how about ipc?

https://code.msdn.microsoft.com/windowsdesktop/C-and-Python-interprocess-171378ee

or IronPython which runs in-process and can operate on/create CLR objects, it can import any python libraries and it’s relatively easy to work with, no need for virtual environments or other hacks

i guess in that case virtual env is used as a Independent python branch which then includes Independent modules as well without touching the base Installation, am i right? not sure if that would be possible using Ironpython.

Normally you can run a single command which activates the VE and launches your Python script within. Never tried in Windows though.

Thanks all - will try Iron Python!

@microdee - Should IronHydra let me do what I need ?

IronHydra is only proof of concept and it was only a coding exercise about threading and external code execution. I’d suggest write your own thin layer plugin around an IronPython segment. Use Visual Studio for that as you can set python source files to copy next to the plugin dll. Also IronHydra haven’t been updated for 4 years now at least a lot have been improved since then.

Good to know. Thanks md

Is it / should it be possible to return data from IP directly to vvvv in a plugin?

IronPython is running in the same appdomain, or in other words IronPython is a Python - CIL transpiler. This means Python code running in IronPython can use, manipulate and create CLR objects as any other .NET language does. So in other words code executing in IronPython has the same scope as the C# code or whatever else running it.

very exciting!

I was incorrect with technicals, it’s using DLR, a dynamic language runtime provider inside .NET, not transpiling python, still the implications and scope are the same

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.