Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have a static site on App Platform that I cannot get to build correctly.
I am using Jinja to generate a static site from some templates. I have a script called build.py in the root directory of the app that does this. It works locally with python 3.8.5, so I know it’s not an issue with the script itself, but maybe the environment. I’ve also gotten the App to run just fine with just the pre-built html made by running the build script locally instead of as a part of the deployment process.
The initial section of the deployment always runs as follows:
=> Initializing build
=> Retrieving source code to /workspace
=> Selecting branch "main"
=> Checking out commit "[a commit hash]"
=> Validating environment
=> Building app using buildpacks
=> Configuring custom build command to be run at the end of the build:
[see below after this section]
=> Running buildpack detection
digitalocean/python-appdetect 0.0.2
heroku/python 0.188.4
digitalocean/procfile 0.0.3
digitalocean/custom 0.1.0
=> Building app
-----> Installing python-3.8.7
-----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
-----> Installing SQLite3
rm: cannot remove '/workspace/.heroku/python/apt/state/lists': Directory not empty
Sqlite3 failed to install.
-----> Installing requirements with pip
Collecting Jinja2==2.11.3
Downloading Jinja2-2.11.3-py2.py3-none-any.whl (125 kB)
Collecting MarkupSafe==1.1.1
Downloading MarkupSafe-1.1.1-cp38-cp38-manylinux2010_x86_64.whl (32 kB)
Installing collected packages: MarkupSafe, Jinja2
Successfully installed Jinja2-2.11.3 MarkupSafe-1.1.1
What comes next fails a few different ways:
When I use python build.py as the build command, it fails with ImportError: No module named site. Running python -V as the build command shows that the command invokes version 2.6.
Switching to python3 build.py as the build command instead fails with
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Running python3 -V as the build command shows it invoking version 3.6.
Switching to python3.8 shows bash: python3.8: command not found
From the logs it looks like python3.8 is installed as a part of building the app, but I can’t seem to invoke it.
Is it possible to run a python script with python3.8 as a part of the build step for a static site on App platform, and if so, how can I invoke it correctly here? Not even sure this would fix the issue, but it certainly isn’t working with python 2.6
a6309a057c3f4cb38fb2e7feb67236
KFSys
ef1ed44cc2154be3bcbb2d727878f8
Devs Neonetworks
1e6b823ea20d4cb189a34a922f5588
Telmo Valverde
erik-jan martens
Henry Mui
anthonycarreon
garantieheld
Marin