Deploy a Django App on App Platform

Connected Tutorial
This question is a follow-up to this tutorial:

The deployment fails with this error when trying to install requirements

2021-10-06T18:03:59.720473494Z => Initializing build 2021-10-06T18:03:59.741010724Z => Retrieving source code to /workspace 2021-10-06T18:03:59.758849751Z => Selecting branch “main” 2021-10-06T18:04:00.159566742Z => Checking out commit “666c7e0ecd55fe5495b3cf4b466b822f82eb6c83” 2021-10-06T18:04:00.535764206Z => Got source_dir: / 2021-10-06T18:04:00.553595240Z => Using workspace root /workspace 2021-10-06T18:04:00.583787726Z 2021-10-06T18:04:00.583894091Z => Building app using buildpacks 2021-10-06T18:04:00.726690445Z => Injecting app environment variables: 2021-10-06T18:04:00.726721849Z DJANGO_SECRET_KEY DJANGO_ALLOWED_HOSTS DEBUG 2021-10-06T18:04:00.968871562Z => Running buildpack detection 2021-10-06T18:04:00.968922679Z 2021-10-06T18:04:01.182965122Z 3 of 4 buildpacks participating 2021-10-06T18:04:01.183077892Z digitalocean/python-appdetect 0.0.2 2021-10-06T18:04:01.183161500Z heroku/python 0.192.4 2021-10-06T18:04:01.183218425Z digitalocean/procfile 0.0.3 2021-10-06T18:04:01.238666259Z 2021-10-06T18:04:01.238807161Z For documentation on the buildpacks used to build your app, please see: 2021-10-06T18:04:01.239063612Z Python: 2021-10-06T18:04:01.468634887Z 2021-10-06T18:04:01.469081066Z => Building app 2021-10-06T18:04:01.469631551Z 2021-10-06T18:04:02.264873958Z -----> Installing python-3.9.4 2021-10-06T18:04:05.434003564Z -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2 2021-10-06T18:04:11.655215061Z -----> Installing SQLite3 2021-10-06T18:04:24.762658484Z rm: cannot remove ‘/workspace/.heroku/python/apt/state/lists’: Directory not empty 2021-10-06T18:04:24.764190145Z Sqlite3 failed to install. 2021-10-06T18:04:24.944953367Z -----> Installing requirements with pip 2021-10-06T18:04:25.958222556Z Collecting asgiref==3.4.1 2021-10-06T18:04:25.993613638Z Downloading asgiref-3.4.1-py3-none-any.whl (25 kB) 2021-10-06T18:04:26.041369300Z Collecting autopep8==1.5.5 2021-10-06T18:04:26.052029519Z Downloading autopep8-1.5.5-py2.py3-none-any.whl (44 kB) 2021-10-06T18:04:26.115587717Z Collecting brotlipy==0.7.0 2021-10-06T18:04:26.128663696Z Downloading brotlipy-0.7.0-cp39-cp39-manylinux1_x86_64.whl (1.1 MB) 2021-10-06T18:04:26.224058551Z Collecting certifi==2021.5.30 2021-10-06T18:04:26.236715107Z Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB) 2021-10-06T18:04:26.268020785Z Processing /C:/ci/cffi_1625831756778/work 2021-10-06T18:04:26.293704846Z ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ‘/C:/ci/cffi_1625831756778/work’ 2021-10-06T18:04:26.293726272Z
2021-10-06T18:04:26.466895464Z ERROR: failed to build: exit status 1 2021-10-06T18:04:28.016458258Z 2021-10-06T18:04:28.016494065Z For documentation on the buildpacks used to build your app, please see: 2021-10-06T18:04:28.016501548Z Python: 2021-10-06T18:04:28.018683649Z 2021-10-06T18:04:28.019290063Z  ! Build failed (145)


The same issue happened with me!

Hey there!

Looking through your output it looks like this may have been configured with a specific directory or file that can’t be found. Did you make any changes from the tutorial that could account for the C:/ci/cffi1625831756778/work directory?

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

It looks like that you have the /C:/ci/cffi_1625831756778/work hardcoded either in your environment variables or somewhere in your code. I would recommend adjusting this to be a relative path rather than an absolute one.

That way when you deploy your project to a different server rather than your local Windows PC, the path would not have to be adjusted.

Also as a side note, here is a very good tutorial on how to deploy Django to the App platform:

Let me know how it goes. Best, Bobby