ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects

We Are Going To Discuss About ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects. So lets Start this Python Article.

ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects

  1. How to solve ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects

    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.

  2. ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects

    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.

Solution 1

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 :

  1. Create runtime.txt in root directory.
  2. python-3.8.10 <- write this in ‘runtime.txt‘ there as to specify the version.
  3. 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.

Original Author 20BCS055_Ankur Mishra Of This Content

Solution 2

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.

Original Author Shloka Bhalgat Of This Content

Solution 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

Original Author sameer arshad Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment