You can't use a variable before declaring it.
You could however use an empty string:
existingUsername = ""
# .
# .
# the rest of your program
# .
# .
username = input()
if username == existingUsername:
print('Sorry, that username is taken, please try again:')
else:
# assign new username here
existingUsername = username
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…