Follow the below steps:
1. Open CMD and Go to the python folder where pip is installed.
2. Type below command.
pip install tabpy-server
3. Similarily open another terminal follow the same as step 1 and write below command for tabpy client
pip install tabpy-client
4. After both are successfully installed, Go to Python folder -> Lib - > site-packages - > tabpy-server.
5. Click on the Startup file as shown in the image below
6. A window opens with Port No and tabpy-server initiated.
7. Then Go to Tableau Desktop and got to Manage External Service Connections.
8. Enter the port No and the service as 9004 and Tabpy/External API.
9. Click on text connection to check connection.
If the above message is not visible then the tabpy-server is closed or not running, so run again and check connection.
10. Click ok.
Tableau can be used with python now.
Hope it helps!.