109
42
I was having the same error while deploying my application on heroku and well the problem is actually that when you are deploying it on heroku so heroku by default uses python version 3.10.x and backports.zoneinfo is not working properly with this version so I suggest you to switch to version 3.8.x(stable).
In order to do that you need to tell heroku to switch that version and it can be done as follows :
- Create runtime.txt in root directory.
- python-3.8.10 <- write this in βruntime.txtβ there as to specify the version.
- heroku will then install this version and you will be not getting anymore error.
PS : worked it for me and later when heroku removes this bug you can switch to python latest version.
- [Django]-Unsupported operand type(s) for *: 'float' and 'Decimal'
- [Django]-Pagination in Django-Rest-Framework using API-View
- [Django]-Is there something similar to 'rake routes' in django?
8
I was facing the same error while creating my container. I solved the error by using the exact version of my Python venv i.e. 3.8.9
Earlier for the image, I was using 3.8-alpine for a lighter version of the image. But, it wasnβt working out for me and got the same error as yours.
- [Django]-'NOT NULL constraint failed' after adding to models.py
- [Django]-How to debug Django commands in PyCharm
- [Django]-Django post_save() signal implementation
3
this type of problems occur when you forget to modify your requirements.txt file and heroku server uses default settings like it uses python updated version which is not stable.
use the following commands and you will be get rid of this type of problem.
$ git status
you need to modify requirements.txt
$ git add-A
$ git commit -m "Python VERSION-3.8.10"
then push your server and i am sure you will be get rid of this type of problem.
In order to push your serverβ¦
$ git push heroku master
- [Django]-Change a Django form field to a hidden field
- [Django]-What does on_delete do on Django models?
- [Django]-Tailwindcss: fixed/sticky footer on the bottom
- [Django]-How do you convert a PIL `Image` to a Django `File`?
- [Django]-Can I make an admin field not required in Django without creating a form?
- [Django]-What is more efficient .objects.filter().exists() or get() wrapped on a try
3
Tried & tested on Mac pro:
Check your python version on your terminal
python3 --version
OR
python --version
If the python version is 3.9 & above , then update the following (backports.zoneinfo) line in your "requirements.txt" file to :
- backports.zoneinfo;python_version<"3.9"
Run β
pip3 install -r requirements.txt
test running your app again , should work at this stage.
- [Django]-Django β Rotating File Handler stuck when file is equal to maxBytes
- [Django]-How to register users in Django REST framework?
- [Django]-Python MySQLDB: Get the result of fetchall in a list
1
I was facing the same error while deploying my Scrapy spider onto Heroku
but using python-3.9.15 in runtime.txt resolved the issue.
however, the python installed in my venv was 3.8.13
you can try one of these I donβt know their actual meaning but these are recommended by Heroku you can read the full documentation here
Supported runtimes
python-3.10.8 on all supported stacks (recommended)
python-3.9.15 on all supported stacks
python-3.8.15 on Heroku-18 and Heroku-20 only
python-3.7.15 on Heroku-18 and Heroku-20 only
- [Django]-Django: reverse accessors for foreign keys clashing
- [Django]-Django Rest Framework β Updating a foreign key
- [Django]-Django-debug-toolbar not showing up
1
for MAC users:
export C_INCLUDE_PATH=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/Headers
only this helped me. source is here
- [Django]-Combining Django F, Value and a dict to annotate a queryset
- [Django]-How to display the current year in a Django template?
- [Django]-Dynamic choices field in Django Models
1
If you are in CentOS, you might be missing one of the Python development libraries that are required to build backports.zoneinfo
. You can try
sudo yum install python3-devel
To install them
- [Django]-"gettext()" vs "gettext_lazy()" in Django
- [Django]-"Post Image data using POSTMAN"
- [Django]-How do I see stdout when running Django tests?
0
use python version 3.11 instead of 3.12
these packages yarl==1.9.2 frozenlist==1.3.3 aiohttp==3.8.4 donβt have compatibility with Python 3.12 for some reason or not yet compatible.
- [Django]-How to access Enum types in Django templates
- [Django]-Django 1.8 Run a specific migration
- [Django]-When to use Serializer's create() and ModelViewset's perform_create()
-1
Install venv with python3.9 version helped for me.
python3.9 default version in my system
python3.9 -m venv venv
- [Django]-How to get a list of all users with a specific permission group in Django
- [Django]-Multiple Models in a single django ModelForm?
- [Django]-What's the difference between ContentType and MimeType?