SirWerto

SirWerto

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! :smiley:

Showing Posts 8 to 1

SirWerto

SirWerto OP

Excellent post!! thank you, marked as solution too :slight_smile:

The forum only allow me to select one solution :cry: sorry

SirWerto

SirWerto OP

It works!!, at least it loads the packages:)

I am going to try it more this weekend
thanks :slight_smile:

dtew

dtew

You may also find some goodness within @alvises blog here: Real-time Object Detection with Phoenix and Python

ImNotAVirus

ImNotAVirus

I made a mistake in my previous answer and I just corrected it. Try to use the PYTHONPATH and not PYTHONHOME variable.

SirWerto

SirWerto OP

uuh, that sounds great

ImNotAVirus

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'}]}])
SirWerto

SirWerto OP

Sorry for the delay

I mean, when you are going to work on your project, you usually start activating your environment

source myproject_env/bin/activate

and then, you have access to all the dependencies your project needs

python my_app.py

so the question is, can i activate my environment using a port?

pd: I know i can just install all the dependencies in the machine but I want to know if someone knows something about this:)
pd2: Also I want to know how is it do it in a professional environment.

thanks :slight_smile:

trisolaran

trisolaran

That’s an interesting question! Which however I don’t fully understand :smiley:
What do you mean exactly?

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews