How to Solve NameError: name 'carrier' is not defined -- phonenumbers
Solution: Import the 'carrier' module
To Solve the error, add the following line to the top of your code.
from phonenumbers import carrier
For more information:
Python phonenumbers carrier