In the Kaggle documentation on TPU usage, they specify that TPU's are supported through TensorFlow 2.1, so I'm wondering if it's even possible. You shouldn't have to uninstall TensorFlow, and honestly I'm not sure if uninstalling will make a difference.
Here's what I tried in a Kaggle notebook:
!pip install tensorflow==2.2
gave this error:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a69b080>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a69bba8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a5f7160>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a5f7128>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a5f72e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
ERROR: Could not find a version that satisfies the requirement tensorflow==2.2 (from versions: none)
ERROR: No matching distribution found for tensorflow==2.2
!pip install tensorflow==1.1
gave the same error
However, !pip install tensorflow
and !pip install tensorflow==2.1
works, however it installs TensorFlow 2.1.
Check out https://www.kaggle.com/docs/tpu for further information, or it might also be worth emailing them and asking. It would make sense if they only use TF 2.1 though for their kernels.