ianknauer
I have some code in my application that calls to a python function (relying on a python library) to convert HTML pages to PDFS. Using the directions in the blog post here i’m able to use export to run a python script in my application in local development.
I’m having issues when it comes to getting the same behaviour on a production server where i deploy using edeliver & distillery. Currently i’m getting an error where it can’t find the module that i’ve defined.
my guess is that it’s because the venv virtual machine isn’t running, but it’s not clear on how to follow those instructions when it comes to distillery releases (starting up a virtual server afterwards for example?).
My Python code is here and the place i’m calling it from is here.
Anyone have experience deploying python code and can point me in the right direction?
Trending in Questions
Other Trending Topics
Latest Phoenix Threads
Latest on Elixir Forum
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
NobbZ
When you do releases, this is not available. You will need to put the python code into your
privfolder and then use:code.priv_dir/1to find it.ianknauer
Thanks @NobbZ, that got me further along than i was before.
i’m now running into an issue where the program is unable to find the module i’m loading in (weasyprint) when the application is actually running.
However, If i run the application using the console from distillery on the server it has no issues and generates the PDF as expected.
Would it be trying to load python in different ways between these two methods of running the application? my best guess on this is that running server isn’t looking for/finding the correct venv virtual environment while the console is.
NobbZ
Before you started the application, have you sources the environments activation script?