Below is a map of where ball pythons are found in the wild:
IUCN Red List of Threatened Species, species assessors and the authors of the spatial data., CC BY-SA 3.0, via Wikimedia Commons
The ball python is native to west Sub Saharan Africa from Senegal through Cameroon to Sudan and Uganda. It prefers grasslands, savannas, and sparsely wooded areas.
(This is seriously all the Wikipeida page had to say about the ball python's habitat)
If you would like to build your own terrarium for a pet ball python, check out this article by Zen Habitats
Here is the link to the article I got this information from!