Cages- either one will work. However, I believe the best overall would be the 4x2. Especially if you get a Coastal Carpet. They average 7-8 feet as an adult and that little extra bit of floor space will give it some breathing room.
Now if the tank is what you already have it will work fine for 1.5-2 years if you start with a baby. After that the snake will be cramped.

Lizzy, Coastal Carpet at 7 foot here in a 4x2x2 which works, but I moved her into a 6 foot enclosure.
One if my Jungle Carpets never got on the floor in her tall tank except to soak in her water bowl. So for her floor space was not an issue. I think that this was uncommon though. But now as an adult in a 4x4 enclosure she will use the floor since this setup has belly heat.

Esmarelda, Jungle Carpet- though this 4x2x4 is not a must, she makes use of all of the space.
If you have no caging at all right now, the PVC enclosure is great to start with. It will sure make the husbandry much easier. I had tanks for years only because I was unaware of PVC until I joined here. I feel that I wasted a lot of money on those tanks. Everything is just sooo much easier with the PVC.
Temperment- Carpets are known to be defensive and nippy when young. The more you work with them, the sooner they will calm down. Also,the bites don’t hurt at all when young.
I have 5 Carpets that range from 6-8 feet and they are all sweethearts. I really enjoy handling sessions with the Carpets. They are really fun snakes. I’m sure your experience will similar.

Lizzy when she was 7 foot