If you are modifying the PATH environment variable from the environment variables in our dashboard this will cause issues. The problem is that referring to other environment variables in Render environment variables, they are not expanded out, they are just text values. So setting PATH on our dashboard to /opt/render/.local/bin/:$PATH means PATH will just be /opt/render/.local/bin/:$PATH in the environment. This also results in clobbering the PATH we have already set.
Can you explain further why you need to add /opt/render/.local/bin to the path? Python is included within your NodeJS service.
I want to provide more details about the situation:
I used “pip install -r requirements.txt && npm install” because my app includes a Python script that is executed by child_process. This setup succeeded during the build process, and the service became live and worked perfectly. However, when attempting to access the endpoint that runs the script, I encountered an error similar to the one below (apologies for not having a screenshot):
Nevertheless, after re-deploying, everything is now working as expected. I’m unsure what exactly resolved the issue. Could it have been the “.profile” I created with “export PATH=”/opt/render/.local/bin:$PATH"" inside?