Okay yall, I am running into some issues when deploying my Phoenix App to Heroku.
Utilizing ErlPort with a python enviroment set in ‘/priv/py38’ of my root. Inside my GenServer class I initiate the server by using:
priv_path = to_charlist(Path.join(:code.priv_dir(:my_app), "py38"))
{:ok, py} = :python.start_link([{:python_path, priv_path}])
this will start the python instance and let me import modules, locally. However this fails when I deploy the app to Heroku. It is not using the correct interpreter and will initiate the python instance, however cannot find any of the modules in my virtual enviroment.
Any ideas on this one? I have tried:
{:ok, py} = :python.start_link([{:python_path, priv_path}]) # works but python enviroment is WRONG
{:ok, py} = :python.start_link([{:python_path, priv_path, :python, "python3"}]) # doesnt continue
{:ok, py} = :python.start_link([{:python_path, priv_path}, {:python, "python3"}]) # doesnt continue
{:ok, py} = :python.start_link([{:python_path, priv_path}, {:python, priv_path}]) # doesnt continue
{:ok, py} = :python.start_link([{:python_path, priv_path}, {:env, [{"py38", priv_path}]}]) # doesnt continue
The ones flagged as doesnt continue seems to exit the attempt and reset, without following up to any log statements afterwards and goes to listening on the channel.
The only one that works is the first try, it will even find a python file dropped into the root of my python virtual enviroment, however fail to find the modules such as pandas. I have attempted changing the directory directly to ‘py38/Lib/site-packages’, and even this fails.
I am 99% certain this is an interpreter issue, however I cannot seem to figure out how to change the interpreter.