SirWerto
Machine learning in Elixir
Good evening,
I am doing a machine learning application and unfortunately I can’t do it yet in Elixir (thank you for all your effort put in Nx:)). So, I decided to make a port (a bare port, not ErlPort) but I’m struggling with python envs.
Does anyone know how to launch a python program with a python environment activated in Elixir?
And for the people who deploy machine learning models in production, how do you do that?Thanks:)
Thanks! ![]()
Marked As Solved
ImNotAVirus
I have never tried it but I think that setting the environment variable PYTHONPATH should be enough.
If you’re using Port.open/2 you can try
port = Port.open({:spawn, cmd}, [:binary, {:env, [{'PYTHONPATH', '/path/to/your/venv/Lib/site-packages'}]}])
Also Liked
dtew
You may also find some goodness within @alvises blog here: Real-time Object Detection with Phoenix and Python
ImNotAVirus
I made a mistake in my previous answer and I just corrected it. Try to use the PYTHONPATH and not PYTHONHOME variable.








