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.
Last Post!
SirWerto
Excellent post!! thank you, marked as solution too ![]()
The forum only allow me to select one solution
sorry
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









