Hello, I have a web app and a postgres db. When I deploy the web app without the python manage.py migrate
command, it builds successfully. However, as I’m deploying a django app (API), I need to migrate so that it can access the database but when I add the migrate command I get the following error:
[INFO] Running custom build command: 'python manage.py migrate'
Python path configuration:
PYTHONHOME = '/home/koyeb/.heroku/python'
PYTHONPATH = '/home/koyeb'
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/bin/python'
sys.base_prefix = '/home/koyeb/.heroku/python'
sys.base_exec_prefix = '/home/koyeb/.heroku/python'
sys.platlibdir = 'lib'
sys.executable = '/usr/bin/python'
sys.prefix = '/home/koyeb/.heroku/python'
sys.exec_prefix = '/home/koyeb/.heroku/python'
sys.path = [
'/home/koyeb',
'/home/koyeb/.heroku/python/lib/python310.zip',
'/home/koyeb/.heroku/python/lib/python3.10',
'/home/koyeb/.heroku/python/lib/python3.10/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007f431753a000 (most recent call first):
<no Python frame>
I was using python3.12 but switched to python3.11 as the docs say python3.12 isn’t yet supported and got the same error. I’m new to Koyeb so I’m not sure how to solve this and whether it’s due to something I’ve done or something else.
Thank you